Skip to content

Commit

Permalink
Merge pull request #185 from decentralized-identity/feat/linea-goerli
Browse files Browse the repository at this point in the history
feat: add linea:goerli deployment
  • Loading branch information
simonas-notcat authored Jul 12, 2023
2 parents c6f4625 + b7a36b3 commit 02fed04
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
2 changes: 2 additions & 0 deletions src/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
54 changes: 28 additions & 26 deletions src/__tests__/networks.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }] })
Expand Down Expand Up @@ -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`],
},
})
})
Expand Down
1 change: 1 addition & 0 deletions src/config/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
]
3 changes: 2 additions & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const infuraNames: Record<string, string> = {
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
Expand Down

0 comments on commit 02fed04

Please sign in to comment.