Skip to content

Commit 9106ab3

Browse files
Construct did:mydata 'to_did' from 'their_did' in a connection record
Signed-off-by: George J Padayatti <[email protected]>
1 parent 4427111 commit 9106ab3

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

mydata_did/v1_0/manager.py

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,8 @@ async def send_create_did_message(self, did: str) -> MyDataDIDRegistryDIDCommTra
462462
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
463463

464464
# to_did
465-
pairwise_remote_did_record = await storage.search_records(
466-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
467-
tag_query={"did": connection_record.their_did}
468-
).fetch_single()
469465
to_did = DIDMyData.from_public_key_b58(
470-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
466+
connection_record.their_did, key_type=KeyType.ED25519)
471467

472468
# to be created did
473469
# Fetch local did record for verkey provided.
@@ -682,12 +678,8 @@ async def send_read_did_message(self, did: str) -> MyDataDIDRegistryDIDCommTrans
682678
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
683679

684680
# to_did
685-
pairwise_remote_did_record = await storage.search_records(
686-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
687-
tag_query={"did": connection_record.their_did}
688-
).fetch_single()
689681
to_did = DIDMyData.from_public_key_b58(
690-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
682+
connection_record.their_did, key_type=KeyType.ED25519)
691683

692684
# Create read-did message
693685
read_did_message = ReadDIDMessage(
@@ -919,12 +911,8 @@ async def send_delete_did_message(self, did: str) -> MyDataDIDRegistryDIDCommTra
919911
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
920912

921913
# to_did
922-
pairwise_remote_did_record = await storage.search_records(
923-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
924-
tag_query={"did": connection_record.their_did}
925-
).fetch_single()
926914
to_did = DIDMyData.from_public_key_b58(
927-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
915+
connection_record.their_did, key_type=KeyType.ED25519)
928916

929917
# To be deleted did
930918

@@ -2315,12 +2303,8 @@ async def construct_data_agreement_offer_message(self, connection_record: Connec
23152303
remote_records[0].tags.get("did"))
23162304

23172305
# Principle DID from connection record
2318-
pairwise_remote_did_record = await storage.search_records(
2319-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2320-
tag_query={"did": connection_record.their_did}
2321-
).fetch_single()
23222306
principle_did = DIDMyData.from_public_key_b58(
2323-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2307+
connection_record.their_did, key_type=KeyType.ED25519)
23242308

23252309
# Construct data agreement negotiation offer message
23262310

@@ -2496,12 +2480,8 @@ async def resolve_remote_mydata_did(self, *, mydata_did: str) -> MyDataDIDRespon
24962480
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
24972481

24982482
# to_did
2499-
pairwise_remote_did_record = await storage.search_records(
2500-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2501-
tag_query={"did": connection_record.their_did}
2502-
).fetch_single()
25032483
to_did = DIDMyData.from_public_key_b58(
2504-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2484+
connection_record.their_did, key_type=KeyType.ED25519)
25052485

25062486
# Create read-did message
25072487
read_did_message = ReadDIDMessage(
@@ -3030,12 +3010,8 @@ async def construct_data_agreement_verify_request(self, *, data_agreement_id: st
30303010
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
30313011

30323012
# to_did
3033-
pairwise_remote_did_record = await storage.search_records(
3034-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
3035-
tag_query={"did": auditor_connection_record.their_did}
3036-
).fetch_single()
30373013
to_did = DIDMyData.from_public_key_b58(
3038-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
3014+
connection_record.their_did, key_type=KeyType.ED25519)
30393015

30403016
# Fetch data agreement instance
30413017
data_agreement_instances = await self.query_data_agreement_instances(

0 commit comments

Comments
 (0)