Skip to content

Commit

Permalink
Add default key seed for key gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Dec 21, 2023
1 parent fc69c68 commit 8325db4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# w3c/vc-di-ed25519signature2020-test-suite ChangeLog

## 1.1.0 - 2023-12-21

### Added
- Add a default key seed for test data generation.

## 1.0.0 - 2023-11-09

### Added
Expand Down
5 changes: 4 additions & 1 deletion tests/vc-generator/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const didKeyDriver = didKey.driver();
* @returns {Promise<object>} - Returns the resulting did key driver result.
*/
export const getDidKey = async ({
seedMultiBase = process.env.KEY_SEED_DB
seedMultiBase = (
process.env.KEY_SEED_DB ||
'z1AYMku6XEB5KV3XJbYzz9VejGJYRuqzu5wmq4JDRyUCjr8'
)
} = {}) => {
// convert multibase seed to Uint8Array
const seed = decodeSecretKeySeed({secretKeySeed: seedMultiBase});
Expand Down
3 changes: 0 additions & 3 deletions tests/vc-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const vcCache = new Map();

// this will generate the signed Vcs for the test
export async function generateTestData() {
if(!process.env.KEY_SEED_DB) {
throw new Error(`ENV variable KEY_SEED_DB is required.`);
}
const {methodFor} = await getDidKey();
const key = methodFor({purpose: 'capabilityInvocation'});
// use copies of the validVc in other tests
Expand Down

0 comments on commit 8325db4

Please sign in to comment.