Skip to content

Commit

Permalink
feat: add Sepolia deployment (decentralized-identity#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis authored Dec 5, 2023
1 parent db82d01 commit 94015bf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
27 changes: 27 additions & 0 deletions src/__tests__/networks.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,33 @@ describe('ethrResolver (alt-chains)', () => {
})
})

it('resolves on sepolia when configured', async () => {
const did = 'did:ethr:sepolia:' + 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': expect.anything(),
id: did,
verificationMethod: [
{
id: `${did}#controller`,
type: 'EcdsaSecp256k1RecoveryMethod2020',
controller: did,
blockchainAccountId: `eip155:11155111:${checksumAddr}`,
},
],
authentication: [`${did}#controller`],
assertionMethod: [`${did}#controller`],
},
})
})

// socket hangup
it.skip('resolves on rsk when configured', async () => {
const did = 'did:ethr:rsk:' + addr
Expand Down
3 changes: 2 additions & 1 deletion src/config/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ export const deployments: EthrDidRegistryDeployment[] = [
// { chainId: 3, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'ropsten', legacyNonce: true },
// { chainId: 4, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'rinkeby', legacyNonce: true },
{ chainId: 5, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'goerli', legacyNonce: true },
// // rsk networks cause socket hang up
{ chainId: 11155111, registry: '0x03d5003bf0e79C5F5223588F347ebA39AfbC3818', name: 'sepolia', legacyNonce: false },
// { chainId: 42, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'kovan', legacyNonce: true },
// // rsk networks cause socket hang up
// { chainId: 30, registry: '0xdca7ef03e98e0dc2b855be647c39abe984fcf21b', name: 'rsk', legacyNonce: true },
// {
// chainId: 31,
Expand Down
8 changes: 4 additions & 4 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ const infuraNames: Record<string, string> = {
'linea:goerli': 'linea-goerli',
}

const knownInfuraNames = ['mainnet', 'goerli', 'aurora', 'linea:goerli']
const knownInfuraNames = ['mainnet', 'goerli', 'aurora', 'linea:goerli', 'sepolia']

/**
* A configuration entry for an ethereum network
* It should contain at least one of `name` or `chainId` AND one of `provider`, `web3`, or `rpcUrl`
*
* @example ```js
* { name: 'development', registry: '0x9af37603e98e0dc2b855be647c39abe984fc2445', rpcUrl: 'http://127.0.0.1:8545/' }
* { name: 'goerli', chainId: 5, provider: new InfuraProvider('goerli') }
* { name: 'rinkeby', provider: new AlchemyProvider('rinkeby') }
* { name: 'sepolia', chainId: 11155111, provider: new InfuraProvider('sepolia') }
* { name: 'goerli', provider: new AlchemyProvider('goerli') }
* { name: 'rsk:testnet', chainId: '0x1f', rpcUrl: 'https://public-node.testnet.rsk.co' }
* ```
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ function configureNetworks(conf: MultiProviderConfiguration): ConfiguredNetworks
* [
* { name: 'development', registry: '0x9af37603e98e0dc2b855be647c39abe984fc2445', rpcUrl: 'http://127.0.0.1:8545/' },
* { name: 'goerli', chainId: 5, provider: new InfuraProvider('goerli') },
* { name: 'rinkeby', provider: new AlchemyProvider('rinkeby') },
* { name: 'sepolia', provider: new AlchemyProvider('sepolia') },
* { name: 'rsk:testnet', chainId: '0x1f', rpcUrl: 'https://public-node.testnet.rsk.co' },
* ]
* ```
Expand Down

0 comments on commit 94015bf

Please sign in to comment.