Skip to content

Commit

Permalink
Start work on common setup and proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Nov 13, 2024
1 parent 65c0d6f commit 5f7385c
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions tests/suites/algorithms.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ async function _setup({
suiteName,
keyType
}) {
// stub suite canonize via Proxy cryptosuite.canonize and set safe to false
const credentials = new Map();
const keyPair = await getMultiKey({keyType});
const signer = keyPair.signer();
Expand All @@ -229,6 +228,7 @@ async function _setup({
mandatoryPointers
})
})));
// stub suite canonize via Proxy cryptosuite.canonize and set safe to false
credentials.set('noTypeOrCryptosuite',
await issueCloned(_generateNoTypeCryptosuite({
signer,
Expand Down Expand Up @@ -295,6 +295,38 @@ function unsafeProxy(suite) {
});
}

function _commonSetup({}) {
async function _commonSetup({
credential,
mandatoryPointers,
selectivePointers,
suiteName,
keyType
}) {
const credentials = new Map();
const keyPair = await getMultiKey({keyType});
const signer = keyPair.signer();
const _credential = structuredClone(credential);
_credential.issuer = keyPair.controller;
const {suite, selectiveSuite} = getSuites({
signer,
suiteName,
selectivePointers,
mandatoryPointers
});
credentials.set('invalidHash', await issueCloned({
credential: _credential,
suite: invalidHashProxy({suite, suiteName}),
selectiveSuite: invalidHashProxy({suite: selectiveSuite, suiteName})
}));
return credentials;
}

function invalidHashProxy({
suiteName,

Check failure on line 325 in tests/suites/algorithms.js

View workflow job for this annotation

GitHub Actions / lint (20.x)

'suiteName' is defined but never used
suite,
}) {
if(typeof suite !== 'object') {
return suite;
}

}

0 comments on commit 5f7385c

Please sign in to comment.