From 46d90ce93240def4497ca93db1c5015f5db98a98 Mon Sep 17 00:00:00 2001 From: Chase Wright Date: Fri, 11 Sep 2020 09:47:55 -0500 Subject: [PATCH] problem: invalid eth_chainId for Ethereum Mainnet --- .../dshackle/upstream/calls/DefaultEthereumMethods.kt | 4 ++-- .../dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index 0e89b490..919248d9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -134,7 +134,7 @@ class DefaultEthereumMethods( "eth_chainId" -> { when { Chain.ETHEREUM == chain -> { - "\"0x0\"" + "\"0x1\"" } Chain.ETHEREUM_CLASSIC == chain -> { "\"0x3d\"" @@ -186,4 +186,4 @@ class DefaultEthereumMethods( override fun getSupportedMethods(): Set { return allowedMethods.plus(hardcodedMethods).toSortedSet() } -} \ No newline at end of file +} diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy index 930f9aeb..917a9723 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy @@ -19,7 +19,7 @@ class DefaultEthereumMethodsSpec extends Specification { new String(new DefaultEthereumMethods(chain).executeHardcoded("eth_chainId")) == id where: chain | id - Chain.ETHEREUM | '"0x0"' + Chain.ETHEREUM | '"0x1"' Chain.ETHEREUM_CLASSIC | '"0x3d"' Chain.TESTNET_KOVAN | '"0x2a"' Chain.TESTNET_GOERLI | '"0x5"'