Skip to content

Commit

Permalink
revert create key changes in did operation
Browse files Browse the repository at this point in the history
Signed-off-by: PatStLouis <[email protected]>
  • Loading branch information
PatStLouis committed Sep 27, 2024
1 parent 7256ce6 commit a53f017
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions aries_cloudagent/wallet/askar.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,24 @@ async def create_local_did(
metadata = {}

try:

keypair = _create_keypair(key_type, seed)
verkey_bytes = keypair.get_public_bytes()
verkey = bytes_to_b58(verkey_bytes)

try:
await self.create_key(key_type, seed, metadata)
await self._session.handle.insert_key(
verkey,
keypair,
metadata=json.dumps(metadata)
)
except AskarError as err:
if err.code == AskarErrorCode.DUPLICATE:
# update metadata?
pass
else:
raise WalletError("Error inserting key") from err

keypair = _create_keypair(key_type, seed)
verkey_bytes = keypair.get_public_bytes()
verkey = bytes_to_b58(verkey_bytes)

did = did_validation.validate_or_derive_did(
method, key_type, verkey_bytes, did
)
Expand Down

0 comments on commit a53f017

Please sign in to comment.