diff --git a/src/__tests__/config.test.ts b/src/__tests__/config.test.ts index 8d48819b..1a081485 100644 --- a/src/__tests__/config.test.ts +++ b/src/__tests__/config.test.ts @@ -18,6 +18,8 @@ describe('configuration', () => { expect(contracts['kovan']).toBeDefined() expect(contracts['0x2a']).toBeDefined() expect(contracts['dev']).toBeDefined() + expect(contracts['linea:goerli']).toBeDefined() + expect(contracts['0xe704']).toBeDefined() }) it('works with infuraProjectId and overrides', () => { diff --git a/src/__tests__/networks.integration.test.ts b/src/__tests__/networks.integration.test.ts index 54d7aef7..2af510e9 100644 --- a/src/__tests__/networks.integration.test.ts +++ b/src/__tests__/networks.integration.test.ts @@ -65,6 +65,33 @@ describe('ethrResolver (alt-chains)', () => { }) }) + it('resolves on linea:goerli when configured', async () => { + const did = 'did:ethr:linea:goerli:' + addr + const ethr = getResolver({ + infuraProjectId: '6b734e0b04454df8a6ce234023c04f26', + }) + const resolver = new Resolver(ethr) + const result = await resolver.resolve(did) + expect(result).toEqual({ + didDocumentMetadata: {}, + didResolutionMetadata: { contentType: 'application/did+ld+json' }, + didDocument: { + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'], + id: did, + verificationMethod: [ + { + id: `${did}#controller`, + type: 'EcdsaSecp256k1RecoveryMethod2020', + controller: did, + blockchainAccountId: `eip155:59140:${checksumAddr}`, + }, + ], + authentication: [`${did}#controller`], + assertionMethod: [`${did}#controller`], + }, + }) + }) + it('resolves on rsk when configured', async () => { const did = 'did:ethr:rsk:' + addr const ethr = getResolver({ networks: [{ name: 'rsk', rpcUrl: 'https://did.rsk.co:4444' }] }) @@ -182,34 +209,9 @@ describe('ethrResolver (alt-chains)', () => { controller: did, publicKeyHex: '036d148205e34a8591dcdcea34fb7fed760f5f1eca66d254830833f755ff359ef0', }, - { - controller: did, - id: `${did}#delegate-1`, - publicKeyHex: 'c4c323b4ba114591579d92591b26e92e59aa5529c6adbebb820da7ca407e9d34', - type: 'Ed25519VerificationKey2018', - }, - { - controller: did, - id: `${did}#delegate-2`, - publicKeyHex: - '04ebafc30f377af345bb86c9269ed6432d6245b44f01dd410f8c0e73ab1801211c84b76fade77b4d6e27da82d051e3603b35c21072201e1a1c00073ab09d004ee4', - type: 'EcdsaSecp256k1VerificationKey2019', - }, ], authentication: [`${did}#controller`, `${did}#controllerKey`], - assertionMethod: [`${did}#controller`, `${did}#controllerKey`, `${did}#delegate-1`, `${did}#delegate-2`], - service: [ - { - id: `${did}#service-1`, - serviceEndpoint: 'https://example.com/inbox', - type: 'DIDCommMessaging', - }, - { - id: `${did}#service-2`, - serviceEndpoint: 'https://example.com/inbox2', - type: 'DIDCommMessaging', - }, - ], + assertionMethod: [`${did}#controller`, `${did}#controllerKey`], }, }) }) diff --git a/src/config/deployments.ts b/src/config/deployments.ts index ea8dabfd..9487046a 100644 --- a/src/config/deployments.ts +++ b/src/config/deployments.ts @@ -66,4 +66,5 @@ export const deployments: EthrDidRegistryDeployment[] = [ { chainId: 137, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'polygon', legacyNonce: true }, { chainId: 80001, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'polygon:test', legacyNonce: true }, { chainId: 1313161554, registry: '0x63eD58B671EeD12Bc1652845ba5b2CDfBff198e0', name: 'aurora', legacyNonce: true }, + { chainId: 59140, registry: '0x03d5003bf0e79C5F5223588F347ebA39AfbC3818', name: 'linea:goerli', legacyNonce: false }, ] diff --git a/src/configuration.ts b/src/configuration.ts index 90426cd9..94321a82 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -9,9 +9,10 @@ const infuraNames: Record = { polygon: 'matic', 'polygon:test': 'maticmum', aurora: 'aurora-mainnet', + 'linea:goerli': 'linea-goerli', } -const knownInfuraNames = ['mainnet', 'ropsten', 'rinkeby', 'goerli', 'kovan', 'aurora'] +const knownInfuraNames = ['mainnet', 'ropsten', 'rinkeby', 'goerli', 'kovan', 'aurora', 'linea:goerli'] /** * A configuration entry for an ethereum network