File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
* SPDX-License-Identifier: BSD-3-Clause
4
4
*/
5
5
import {
6
- contexts as credentialsContexts
6
+ contexts as credentialsContexts ,
7
+ named as namedCredentialsContexts
7
8
} from '@digitalbazaar/credentials-context' ;
8
9
import dataIntegrityCtx from '@digitalbazaar/data-integrity-context' ;
9
10
import didCtx from '@digitalcredentials/did-context' ;
@@ -12,12 +13,18 @@ import multikeyCtx from '@digitalbazaar/multikey-context';
12
13
const contextMap = new Map ( credentialsContexts ) ;
13
14
14
15
const _dataIntegrityCtx = structuredClone ( dataIntegrityCtx . CONTEXT ) ;
16
+ const {
17
+ id : v2ContextUrl ,
18
+ context : v2Context
19
+ } = structuredClone ( namedCredentialsContexts . get ( 'v2' ) ) ;
20
+ const v2Ctx = v2Context [ '@context' ] ;
15
21
const diCtx = _dataIntegrityCtx [ '@context' ] ;
16
22
// add UnknownProofType to local context for test data
17
23
diCtx . UnknownProofType =
18
24
structuredClone ( _dataIntegrityCtx [ '@context' ] . DataIntegrityProof ) ;
19
25
// add invalidPurpose to context for test data
20
- diCtx . DataIntegrityProof [ '@context' ] . proofPurpose [ '@context' ] . invalidPurpose = {
26
+ diCtx . DataIntegrityProof [ '@context' ] . proofPurpose [ '@context' ] . invalidPurpose =
27
+ v2Ctx . DataIntegrityProof [ '@context' ] . proofPurpose [ '@context' ] . invalidPurpose = {
21
28
'@id' : 'https://w3id.org/security#invalidPurpose' ,
22
29
'@type' : '@id' ,
23
30
'@container' : '@set'
@@ -34,5 +41,9 @@ contextMap.set(
34
41
didCtx . contexts . get (
35
42
didCtx . constants . DID_CONTEXT_URL )
36
43
) ;
44
+ contextMap . set (
45
+ v2ContextUrl ,
46
+ v2Context
47
+ ) ;
37
48
38
49
export { contextMap } ;
You can’t perform that action at this time.
0 commit comments