@@ -15,7 +15,7 @@ import {
15
15
import { expect } from 'chai' ;
16
16
import { DIDResolutionResult } from 'did-resolver' ;
17
17
import { ES256KSigner } from 'did-jwt' ;
18
- import { DID , Id } from '@iden3/js-iden3-core' ;
18
+ import { DID , getChainId , Id } from '@iden3/js-iden3-core' ;
19
19
import { Hex } from '@iden3/js-crypto' ;
20
20
21
21
const didExample = {
@@ -58,25 +58,15 @@ const didExample = {
58
58
const didExampleRecovery = {
59
59
'@context' : [
60
60
'https://www.w3.org/ns/did/v1' ,
61
- 'https://w3id.org/security/suites/secp256k1recovery-2020/v2' ,
62
- {
63
- esrs2020 : 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#' ,
64
- privateKeyJwk : {
65
- '@id' : 'esrs2020:privateKeyJwk' ,
66
- '@type' : '@json'
67
- } ,
68
- publicKeyHex : 'esrs2020:publicKeyHex' ,
69
- privateKeyHex : 'esrs2020:privateKeyHex' ,
70
- ethereumAddress : 'esrs2020:ethereumAddress'
71
- }
61
+ 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'
72
62
] ,
73
63
id : 'did:iden3:privado:main:2SZDsdYordSH49VhS6hGo164RLwfcQe9FGow5ftSUG' ,
74
64
verificationMethod : [
75
65
{
76
66
id : 'did:iden3:privado:main:2SZDsdYordSH49VhS6hGo164RLwfcQe9FGow5ftSUG#vm-1' ,
77
67
controller : 'did:iden3:privado:main:2SZDsdYordSH49VhS6hGo164RLwfcQe9FGow5ftSUG' ,
78
68
type : 'EcdsaSecp256k1RecoveryMethod2020' ,
79
- blockchainAccountId : 'eip155:1 :0x964e496a1b2541ed029abd5e49fd01e41cd02995'
69
+ blockchainAccountId : 'eip155:21000 :0x964e496a1b2541ed029abd5e49fd01e41cd02995'
80
70
}
81
71
] ,
82
72
authentication : [ 'did:iden3:privado:main:2SZDsdYordSH49VhS6hGo164RLwfcQe9FGow5ftSUG#vm-1' ]
@@ -160,13 +150,14 @@ describe('jws packer tests', () => {
160
150
const ethDid = DID . parse ( ethDidString ) ;
161
151
if ( isEthereumIdentity ( ethDid ) ) {
162
152
const id = DID . idFromDID ( ethDid ) ;
153
+ const chainId = getChainId ( DID . blockchainFromId ( id ) , DID . networkIdFromId ( id ) ) ;
163
154
const address = Hex . encodeString ( Id . ethAddressFromId ( id ) ) ;
164
155
const vms = [
165
156
{
166
157
id : `${ ethDidString } #vm-1` ,
167
158
controller : ethDidString ,
168
159
type : 'EcdsaSecp256k1RecoveryMethod2020' ,
169
- blockchainAccountId : `eip155:1 :0x${ address } `
160
+ blockchainAccountId : `eip155:${ chainId } :0x${ address } `
170
161
}
171
162
] ;
172
163
expect ( vms [ 0 ] . blockchainAccountId ) . to . be . eq (
0 commit comments