Skip to content

Commit

Permalink
Update ENS registry address and lower default quorum for testnets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 30, 2020
1 parent 99329b0 commit edb49da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
14 changes: 9 additions & 5 deletions packages/networks/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ function ethDefaultProvider(network: string): (providers: any) => any {
if (options.quorum != null) {
quorum = options.quorum;
} else if (quorum > 2) {
quorum = 2;
if (network === "homestead") {
quorum = 2;
} else {
quorum = 1;
}
}
return new providers.FallbackProvider(providerList, quorum);
}
Expand All @@ -68,14 +72,14 @@ function etcDefaultProvider(url: string, network: string): (providers: any) => a

const homestead: Network = {
chainId: 1,
ensAddress: "0x314159265dd8dbb310642f98f50c066173c1259b",
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "homestead",
_defaultProvider: ethDefaultProvider("homestead")
};

const ropsten: Network = {
chainId: 3,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten")
};
Expand Down Expand Up @@ -105,7 +109,7 @@ const networks: { [name: string]: Network } = {

rinkeby: {
chainId: 4,
ensAddress: "0xe7410170f87102DF0055eB195163A03B7F2Bff4A",
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "rinkeby",
_defaultProvider: ethDefaultProvider("rinkeby")
},
Expand All @@ -118,7 +122,7 @@ const networks: { [name: string]: Network } = {

goerli: {
chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "goerli",
_defaultProvider: ethDefaultProvider("goerli")
},
Expand Down
15 changes: 14 additions & 1 deletion packages/tests/src.ts/test-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ const blockchainData: { [ network: string ]: TestCases } = {
storage: {
"0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
}
}
},
{
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
name: "ricmoo.firefly.eth"
},
],
blocks: [
{
Expand Down Expand Up @@ -467,6 +471,15 @@ function testProvider(providerName: string, networkName: string) {
});
});
}

if (test.name) {
it(`fetches the ENS name: ${ test.name }`, function() {
this.timeout(20000);
return provider.resolveName(test.name).then((address) => {
equals("ENS Name", test.address, address);
});
});
}
});

tests.blocks.forEach((test) => {
Expand Down

0 comments on commit edb49da

Please sign in to comment.