Skip to content

Commit

Permalink
Use selectiveSuite with stubbed derive function for invalid hmac.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jun 25, 2024
1 parent e9d186c commit eccc968
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/vc-generator/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export function invalidHmac({suite, selectiveSuite, ...args}) {
selectiveSuite._cryptosuite = _proxyStub({
object: selectiveSuite._cryptosuite,
mocks: {

derive: mocks.stubDerive()
}
});
return {...args, suite};
return {...args, suite, selectiveSuite};
}

/**
Expand Down
9 changes: 6 additions & 3 deletions tests/vc-generator/mockMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function concatBuffers(buffers) {
}

export function stubDisclosureData({
name = 'bbs2023',
name = 'bbs-2023',
utfOffset = 0
}) {
return async function({
Expand Down Expand Up @@ -326,8 +326,11 @@ function parseBaseProofValue({proof} = {}) {
}
}

export function stubDerive({utfOffset} = {}) {
const createDisclosureData = stubDisclosureData({utfOffset});
export function stubDerive({
name,
utfOffset
} = {}) {
const createDisclosureData = stubDisclosureData({utfOffset, name});
return async function({
cryptosuite, document, purpose, proofSet,
documentLoader, dataIntegrityProof
Expand Down

0 comments on commit eccc968

Please sign in to comment.