Skip to content

Commit

Permalink
Use unsafeProxy for no proof type or cryptosuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Nov 11, 2024
1 parent f3c464b commit c975ab0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/suites/algorithms.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,14 @@ function _generateNoTypeCryptosuite({
} = generators?.mandatory;
const noType = invalidProofType({
credential: structuredClone(credential),
suite: stubUnsafe(suite),
selectiveSuite: stubUnsafe(selectiveSuite),
suite: unsafeProxy(suite),
selectiveSuite: unsafeProxy(selectiveSuite),
proofType: ''
});
return invalidCryptosuite({...noType, cryptosuiteName: ''});
}

function stubUnsafe(suite) {
function unsafeProxy(suite) {
if(typeof suite !== 'object') {
return suite;
}
Expand All @@ -257,6 +257,7 @@ function stubUnsafe(suite) {
return suite._cryptosuite.canonize(doc, {...options, safe: false});
};
}
return Reflect.get(...arguments);
}
});
}
Expand Down

0 comments on commit c975ab0

Please sign in to comment.