Skip to content

Commit 0fc00aa

Browse files
committed
fix getMultikey to set key id and controller correctly.
1 parent 67d6c73 commit 0fc00aa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/15-di-rdfc-verify.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ const {match} = endpoints.filterByTag({
1818
tags: [...tags],
1919
property: 'verifiers'
2020
});
21+
const {key} = await getMultikey();
2122
// options for the DI Verifier Suite
2223
const testDataOptions = {
2324
suiteName: 'eddsa-rdfc-2022',
2425
cryptosuite: eddsaRdfc2022CryptoSuite,
25-
key: await getMultikey()
26+
key
2627
};
2728

2829
checkDataIntegrityProofVerifyErrors({

tests/vc-generator/helpers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export const getMultikey = async ({
1919
const signer = key.signer();
2020
// The issuer needs to match the signer or the controller of the signer
2121
const issuer = `did:key:${key.publicKeyMultibase}`;
22+
key.controller = issuer;
2223
// verificationMethod needs to be a fragment
23-
// this only works for did:key
24-
signer.id = `${issuer}#${key.publicKeyMultibase}`;
25-
return {signer, issuer};
24+
key.id = signer.id = `${issuer}#${key.publicKeyMultibase}`;
25+
return {signer, issuer, key};
2626
};
2727

2828
/**

0 commit comments

Comments
 (0)