Skip to content

Commit

Permalink
Revert unnecessary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSAssassin committed Nov 6, 2023
1 parent 6f7c5d5 commit e0387fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export async function addRoutes({app, service} = {}) {

const {checks} = options;
_validateChecks({checks});

const result = await vc.verifyCredential({
credential,
documentLoader,
Expand Down Expand Up @@ -190,6 +189,7 @@ export async function addRoutes({app, service} = {}) {
}
({uses: challengeUses} = result);
}

const verifyOptions = {
challenge,
presentation: verifiablePresentation,
Expand Down
15 changes: 6 additions & 9 deletions lib/suites.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,16 @@ const SUPPORTED_LEGACY_SUITES = new Map([
export function createSuites() {
const cfg = bedrock.config['vc-verifier'];
const {supportedSuites} = cfg;
const suites = [];
for(const supportedSuite of supportedSuites) {
const suite = supportedSuites.map(supportedSuite => {
const LegacySuite = SUPPORTED_LEGACY_SUITES.get(supportedSuite);
if(LegacySuite) {
suites.push(new LegacySuite());
continue;
return new LegacySuite();
}
const cryptosuite = SUPPORTED_CRYPTOSUITES.get(supportedSuite);
if(cryptosuite) {
suites.push(new DataIntegrityProof({cryptosuite}));
} else {
throw new Error(`Unsupported suite ${supportedSuite}`);
return new DataIntegrityProof({cryptosuite});
}
}
return suites;
throw new Error(`Unsupported suite ${supportedSuite}`);
});
return suite;
}

0 comments on commit e0387fc

Please sign in to comment.