-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dids): allow to pass in a key instance when creating a did document #1944
fix(dids): allow to pass in a key instance when creating a did document #1944
Conversation
🦋 Changeset detectedLatest commit: 4478cc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
let key = options.options.key | ||
|
||
if (!key && keyType) { | ||
key = await agentContext.wallet.createKey({ | ||
keyType, | ||
seed, | ||
privateKey, | ||
}) | ||
} | ||
|
||
if (!key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to handle where both keyType and key are passed, but they don't match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need to handle the case where privateKey/seed is passed and key as well. That should cause an error. As it results in ambigious behaviour (I have no idea without looking at the code which will take precedence)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(same for all files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now.
key instance cannot be combined with keyType, seed or private key.
can you also add a changest? |
Signed-off-by: Berend Sliedrecht <sliedrecht@berend.io>
edfd99c
to
d08c1cb
Compare
how? |
…ID jwk, key or peer with num algo 0 Signed-off-by: Berend Sliedrecht <sliedrecht@berend.io>
didRegistrationMetadata: {}, | ||
didState: { | ||
state: 'failed', | ||
reason: 'Key instance cannot be combined with key type, seed and or private key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason: 'Key instance cannot be combined with key type, seed and or private key', | |
reason: 'Key instance cannot be combined with key type, seed or private key', |
seed, | ||
privateKey, | ||
}) | ||
if (!key && keyType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can now just be if (keyType)
because of the check above
Signed-off-by: Berend Sliedrecht <sliedrecht@berend.io>
a5235e7
into
openwallet-foundation:main
Signed-off-by: Berend Sliedrecht sliedrecht@berend.io