File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*!
2
2
* Copyright (c) 2019-2024 Digital Bazaar, Inc. All rights reserved.
3
3
*/
4
- import * as vc from '../lib/index.js' ;
5
- import { createDiSuites , createSdSuites } from './helpers.js' ;
6
4
import { createSkewedTimeStamp , issueCredential } from './helpers.js' ;
7
5
import chai from 'chai' ;
8
6
import { documentLoader } from './testDocumentLoader.js' ;
7
+ import { createSuites } from './helpers.js' ;
9
8
import { setupSuites } from './mocks/suites.js' ;
10
9
import { v4 as uuid } from 'uuid' ;
11
10
import { versionedCredentials } from './mocks/credential.js' ;
@@ -82,8 +81,21 @@ function _runSuite({
82
81
return Reflect . get ( ...arguments ) ;
83
82
}
84
83
} ;
85
- const signer = new Proxy ( keyPair . signer ( ) , stubSignerId ) ;
86
- const suites = derived ? createSdSuites ( { signer, cryptosuite} ) : createDiSuites ( { signer, cryptosuite} ) ;
84
+ const stubSigner = {
85
+ get ( target , prop ) {
86
+ if ( prop === 'signer' ) {
87
+ return ( ) => new Proxy ( target . signer ( ) , stubSignerId ) ;
88
+ }
89
+ return Reflect . get ( ...arguments ) ;
90
+ }
91
+ } ;
92
+ const proxyKeyPair = new Proxy ( keyPair , stubSigner ) ;
93
+ const suites = createSuites ( {
94
+ keyPair : proxyKeyPair ,
95
+ cryptosuite,
96
+ suiteName,
97
+ derived
98
+ } ) ;
87
99
let error ;
88
100
try {
89
101
await issueCredential ( {
You can’t perform that action at this time.
0 commit comments