Skip to content

Commit d6f2538

Browse files
committed
Use unsafeProxy for no proof type or cryptosuite.
1 parent 9d05b01 commit d6f2538

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/suites/algorithms.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ function _generateNoTypeCryptosuite({
237237
} = generators?.mandatory;
238238
const noType = invalidProofType({
239239
credential: structuredClone(credential),
240-
suite: stubUnsafe(suite),
241-
selectiveSuite: stubUnsafe(selectiveSuite),
240+
suite: unsafeProxy(suite),
241+
selectiveSuite: unsafeProxy(selectiveSuite),
242242
proofType: ''
243243
});
244244
return invalidCryptosuite({...noType, cryptosuiteName: ''});
245245
}
246246

247-
function stubUnsafe(suite) {
247+
function unsafeProxy(suite) {
248248
if(typeof suite !== 'object') {
249249
return suite;
250250
}
@@ -257,6 +257,7 @@ function stubUnsafe(suite) {
257257
return suite._cryptosuite.canonize(doc, {...options, safe: false});
258258
};
259259
}
260+
return Reflect.get(...arguments);
260261
}
261262
});
262263
}

0 commit comments

Comments
 (0)