Skip to content

Commit

Permalink
More DID integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ntn-x2 committed Oct 4, 2023
1 parent 40361ec commit b88def8
Show file tree
Hide file tree
Showing 2 changed files with 662 additions and 563 deletions.
21 changes: 10 additions & 11 deletions packages/did/src/Did2.rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,17 @@ export function linkedInfoFromChain(
],
}

if (didRec.keyAgreement !== undefined) {
did.keyAgreement = [didRec.keyAgreement[0].id]
did.verificationMethod.push(
didKeyToVerificationMethod(
fromChain(identifier),
didRec.keyAgreement[0].id,
{
keyType: didRec.keyAgreement[0].type,
publicKey: didRec.keyAgreement[0].publicKey,
}
if (didRec.keyAgreement !== undefined && didRec.keyAgreement.length > 0) {
did.keyAgreement = []
didRec.keyAgreement.forEach(({ id, publicKey, type: keyType }) => {
did.keyAgreement?.push(id)
did.verificationMethod.push(
didKeyToVerificationMethod(fromChain(identifier), id, {
keyType,
publicKey,
})
)
)
})
}

if (didRec.assertionMethod !== undefined) {
Expand Down
Loading

0 comments on commit b88def8

Please sign in to comment.