From 055b0f5180c7265bd00e4fbd182c6dce1bc46f29 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 10 Nov 2024 20:10:41 +0000 Subject: [PATCH] Further work on algorithms setup. --- tests/suites/algorithms.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/suites/algorithms.js b/tests/suites/algorithms.js index 2cf07b86..dcdcd35b 100644 --- a/tests/suites/algorithms.js +++ b/tests/suites/algorithms.js @@ -8,6 +8,8 @@ import { issueCloned } from 'data-integrity-test-suite-assertion'; import {createInitialVc, endpointCheck} from '../helpers.js'; +import {getMultiKey} from '../vc-generator/key-gen.js'; +import {getSuites} from './helpers.js'; import {localVerifier} from '../vc-verifier/index.js'; export function commonAlgorithms({ @@ -188,12 +190,37 @@ async function _setup({ selectivePointers, 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(); + const _credential = structuredClone(credential); + _credential.issuer = keyPair.controller; + const {invalidCreated} = generators?.dates; + credentials.set('invalidCreated', await issueCloned(invalidCreated({ + credential: structuredClone(_credential), + ...getSuites({ + signer, + suiteName, + selectivePointers, + mandatoryPointers + }) + }))); + return credentials; +} + +async function _generateNoTypeCryptosuite({ + signer, + credential, + mandatoryPointers, + selectivePointers }) { const { invalidProofType, invalidCryptosuite } = generators?.mandatory; - const credentials = new Map(); - const {invalidCreated} = generators?.dates; + const noType = invalidProofType({ + }); }