Skip to content

Commit

Permalink
stub verify data to so created is not deleted.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jun 28, 2024
1 parent a6d2afd commit 1024243
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import {
allowUnsafeCanonize,
invalidCborEncoding,
invalidStringEncoding
invalidStringEncoding,
passCreated
} from './vc-generator/generators.js';
import {
deriveCredentials,
Expand Down Expand Up @@ -192,12 +193,7 @@ export async function verifySetup({credentials, keyTypes, suite}) {
keys,
vectors: transformVectors(subjectNestedObjects),
suiteName: suite,
initialParams: {
// FIXME while created is not recommended for bbs it should be in
// the disclosed VC too.
selectiveSuite: null
},
generators: [invalidCreated]
generators: [invalidCreated, passCreated]
});
return {
base,
Expand Down
8 changes: 8 additions & 0 deletions tests/vc-generator/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export function allowUnsafeCanonize({suite, selectiveSuite, ...args}) {
return {...args, suite, selectiveSuite};
}

export function passCreated({suite, ...args}) {
suite._cryptosuite = stubMethods({
object: suite._cryptosuite,
stubs: {createVerifyData: stubs.stubVerifyData({deleteCreated: false})},
});
return {...args, suite};
}

export function invalidStringEncoding({suite, selectiveSuite, ...args}) {
suite._cryptosuite = stubMethods({
object: suite._cryptosuite,
Expand Down

0 comments on commit 1024243

Please sign in to comment.