Skip to content

Commit

Permalink
Add V2 Examples Context.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Feb 5, 2024
1 parent edfb5f2 commit 9ff44fe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test/contexts/examples-v2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
*/
const contextUrl = 'https://www.w3.org/ns/credentials/examples/v2';
const context = {
'@context': {
'@vocab': 'https://www.w3.org/ns/credentials/examples#'
}
};
export const constants = {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL: contextUrl};
export const contexts = new Map([[contextUrl, context]]);
9 changes: 9 additions & 0 deletions test/contexts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import {
CONTEXT_V1 as vcExamplesV1Ctx,
CONTEXT_URL_V1 as vcExamplesV1CtxUrl
} from '@digitalbazaar/credentials-examples-context';
import {
constants as vcExamplesV2Constants,
contexts as vcExamplesV2Contexts
} from './examples-v2.js';
import {invalidId} from './invalid_id.js';
import {nullId} from './null_id.js';
import {nullType} from './null_type.js';
Expand All @@ -37,6 +41,7 @@ import {nullVersion} from './null_version.js';
const {CONTEXT_URL: ED25519_CONTEXT_URL} = ed25519Constants;
const {CREDENTIALS_CONTEXT_V1_URL} = credentialsConstants;
const {CONTEXT_URL: CREDENTIALS_CONTEXT_V2_URL} = credentialsV2Constants;
const {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL} = vcExamplesV2Constants;
const {DID_CONTEXT_URL} = didConstants;
const {VERES_ONE_CONTEXT_V1_URL} = v1Constants;

Expand Down Expand Up @@ -68,6 +73,10 @@ export const validContexts = {
examplesContext: {
url: vcExamplesV1CtxUrl,
value: vcExamplesV1Ctx
},
examplesV2Context: {
url: CREDENTIALS_V2_EXAMPLE_CONTEXT_URL,
value: vcExamplesV2Contexts.get(CREDENTIALS_V2_EXAMPLE_CONTEXT_URL)
}
};

Expand Down
2 changes: 1 addition & 1 deletion test/mocks/credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const versionedCredentials = new Map([
[2.0, () => klona({
'@context': [
'https://www.w3.org/ns/credentials/v2',
'https://www.w3.org/2018/credentials/examples/v1'
'https://www.w3.org/ns/credentials/examples/v2'
],
id: 'http://example.edu/credentials/1872',
type: ['VerifiableCredential', 'AlumniCredential'],
Expand Down

0 comments on commit 9ff44fe

Please sign in to comment.