Skip to content

Commit

Permalink
fix(test): remove the connection test for goerli network (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis authored Jun 13, 2024
1 parent 528c514 commit c861026
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 37 deletions.
14 changes: 6 additions & 8 deletions src/__tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ describe('configuration', () => {
})
expect(contracts['mainnet']).toBeDefined()
expect(contracts['0x1']).toBeDefined()
expect(contracts['goerli']).toBeDefined()
expect(contracts['0x5']).toBeDefined()
expect(contracts['dev']).toBeDefined()
expect(contracts['linea:goerli']).toBeDefined()
expect(contracts['0xe704']).toBeDefined()
Expand All @@ -27,19 +25,19 @@ describe('configuration', () => {

it('works with named network', async () => {
const contracts = configureResolverWithNetworks({
networks: [{ name: 'goerli', provider: new JsonRpcProvider('some goerli JSONRPC URL') }],
networks: [{ name: 'linea:goerli', provider: new JsonRpcProvider('some goerli JSONRPC URL') }],
})
expect(contracts['goerli']).toBeDefined()
expect(contracts['0x5']).toBeDefined()
expect(contracts['linea:goerli']).toBeDefined()
expect(contracts['0xe704']).toBeDefined()
})

it('works with single network', async () => {
const contracts = configureResolverWithNetworks({
name: 'goerli',
name: 'linea:goerli',
provider: new JsonRpcProvider('some goerli JSONRPC URL'),
})
expect(contracts['goerli']).toBeDefined()
expect(contracts['0x5']).toBeDefined()
expect(contracts['linea:goerli']).toBeDefined()
expect(contracts['0xe704']).toBeDefined()
})

it('works with single provider', async () => {
Expand Down
27 changes: 0 additions & 27 deletions src/__tests__/networks.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,6 @@ describe('ethrResolver (alt-chains)', () => {
})
})

it('resolves on goerli when configured', async () => {
const did = 'did:ethr:goerli:' + addr
const ethr = getResolver({
networks: [{ name: 'goerli', rpcUrl: 'https://goerli.infura.io/v3/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:5:${checksumAddr}`,
},
],
authentication: [`${did}#controller`],
assertionMethod: [`${did}#controller`],
},
})
})

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

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

/**
* A configuration entry for an ethereum network
Expand Down

0 comments on commit c861026

Please sign in to comment.