@0x/utils: fix wrong RPC method in getChainIdAsync() (#2270)

It was using net_version, but it should be using the eth_chainId method
introduced in EIP-695.  I'm not sure whether/how the network ID differs
from the chain ID on mainnet and the testnets, but in Ganache in
particular, the network ID is 50 while the chain ID is 1337, and this
difference was causing problems for Python tests.  Specifically, the
Web3.py interface `Web3.eth.chainId` invokes the eth_chainId method, and
the result feeds into the order hash, which wasn't lining up with the
non-Python side of things.
This commit is contained in:
F. Eugene Aumson
2019-10-25 21:08:31 -04:00
committed by GitHub
parent 59210f5e5e
commit 0067f10a6a
5 changed files with 17 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ export const constants = {
BASE_16: 16,
INVALID_OPCODE: 'invalid opcode',
TESTRPC_NETWORK_ID: 50,
TESTRPC_CHAIN_ID: 1337,
// Note(albrow): In practice V8 and most other engines limit the minimum
// interval for setInterval to 10ms. We still set it to 0 here in order to
// ensure we always use the minimum interval.