Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
  • Loading branch information
TheTechmage committed Jan 18, 2024
1 parent f6f1332 commit 7916f45
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions didcomm_messaging/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Union,
Callable,
Awaitable,
Sequence,
Tuple,
)
import aiohttp
Expand Down Expand Up @@ -263,7 +262,7 @@ async def send_http_message(


async def setup_relay(
dmp: DIDCommMessaging, my_did: DID, relay_did: DID, keys: Tuple[Key]
dmp: DIDCommMessaging, my_did: DID, relay_did: DID, verkey: Key, xkey: Key
) -> Union[DID, None]:
"""Negotiate services with an inbound relay.
Expand Down Expand Up @@ -293,13 +292,13 @@ async def setup_relay(
[
KeySpec.verification(
multibase.encode(
multicodec.wrap("ed25519-pub", key[0].get_public_bytes()),
multicodec.wrap("ed25519-pub", verkey.get_public_bytes()),
"base58btc",
)
),
KeySpec.key_agreement(
multibase.encode(
multicodec.wrap("x25519-pub", key[1].get_public_bytes()), "base58btc"
multicodec.wrap("x25519-pub", xkey.get_public_bytes()), "base58btc"
)
),
],
Expand All @@ -323,14 +322,14 @@ async def setup_relay(
# destined to us via our new DID
doc = await resolver.resolve_and_parse(new_did)
# New format, key-# is in order of keys in did
await secrets.add_secret(AskarSecretKey(keys[0], f"{new_did}#key-1"))
await secrets.add_secret(AskarSecretKey(keys[1], f"{new_did}#key-2"))
await secrets.add_secret(AskarSecretKey(verkey, f"{new_did}#key-1"))
await secrets.add_secret(AskarSecretKey(xkey, f"{new_did}#key-2"))

# Legacy formats
# verkey
await secrets.add_secret(AskarSecretKey(keys[0], doc.authentication[0]))
await secrets.add_secret(AskarSecretKey(verkey, doc.authentication[0]))
# xkey
await secrets.add_secret(AskarSecretKey(keys[1], doc.key_agreement[0]))
await secrets.add_secret(AskarSecretKey(xkey, doc.key_agreement[0]))

# Send a message to the relay informing it of our new endpoint that people
# should contact us by
Expand Down

0 comments on commit 7916f45

Please sign in to comment.