Skip to content

Commit 0d7213a

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

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

mydata_did/v1_0/manager.py

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -975,12 +975,8 @@ async def send_read_data_agreement_message(self, connection_record: ConnectionRe
975975
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
976976

977977
# to_did
978-
pairwise_remote_did_record = await storage.search_records(
979-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
980-
tag_query={"did": connection_record.their_did}
981-
).fetch_single()
982978
to_did = DIDMyData.from_public_key_b58(
983-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
979+
connection_record.their_did, key_type=KeyType.ED25519)
984980
except StorageError as err:
985981
raise ADAManagerError(
986982
f"Failed to send read-data-agreement message: {err}"
@@ -2569,12 +2565,8 @@ async def construct_data_agreement_negotiation_accept_message(self, *, data_agre
25692565
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
25702566

25712567
# to_did
2572-
pairwise_remote_did_record = await storage.search_records(
2573-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2574-
tag_query={"did": connection_record.their_did}
2575-
).fetch_single()
25762568
to_did = DIDMyData.from_public_key_b58(
2577-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2569+
connection_record.their_did, key_type=KeyType.ED25519)
25782570
except StorageError as err:
25792571
raise ADAManagerError(
25802572
f"Failed to construct data agreement negotiation accept message: {err}"
@@ -2679,12 +2671,8 @@ async def construct_data_agreement_negotiation_reject_message(self, *, data_agr
26792671
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
26802672

26812673
# to_did
2682-
pairwise_remote_did_record = await storage.search_records(
2683-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2684-
tag_query={"did": connection_record.their_did}
2685-
).fetch_single()
26862674
to_did = DIDMyData.from_public_key_b58(
2687-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2675+
connection_record.their_did, key_type=KeyType.ED25519)
26882676
except StorageError as err:
26892677
raise ADAManagerError(
26902678
f"Failed to construct data agreement negotiation accept message: {err}"
@@ -2791,12 +2779,8 @@ async def construct_data_agreement_negotiation_problem_report_message(self, *, c
27912779
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
27922780

27932781
# to_did
2794-
pairwise_remote_did_record = await storage.search_records(
2795-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2796-
tag_query={"did": connection_record.their_did}
2797-
).fetch_single()
27982782
to_did = DIDMyData.from_public_key_b58(
2799-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2783+
connection_record.their_did, key_type=KeyType.ED25519)
28002784
except StorageError as err:
28012785
raise ADAManagerError(
28022786
f"Failed to construct data agreement negotiation problem-report message: {err}"
@@ -2861,12 +2845,8 @@ async def construct_data_agreement_termination_terminate_message(self, *, data_
28612845
pairwise_local_did_record.verkey, key_type=KeyType.ED25519)
28622846

28632847
# to_did
2864-
pairwise_remote_did_record = await storage.search_records(
2865-
type_filter=ConnectionManager.RECORD_TYPE_DID_KEY,
2866-
tag_query={"did": connection_record.their_did}
2867-
).fetch_single()
28682848
to_did = DIDMyData.from_public_key_b58(
2869-
pairwise_remote_did_record.value, key_type=KeyType.ED25519)
2849+
connection_record.their_did, key_type=KeyType.ED25519)
28702850
except StorageError as err:
28712851
raise ADAManagerError(
28722852
f"Failed to construct data agreement termination terminate message: {err}"

0 commit comments

Comments
 (0)