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 59b13f72..ca75c7a8 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -129,16 +129,16 @@ class DefaultEthereumMethods( "eth_chainId" -> { when { Chain.ETHEREUM == chain -> { - "0x0" + "\"0x0\"" } Chain.ETHEREUM_CLASSIC == chain -> { - "0x3d" + "\"0x3d\"" } Chain.TESTNET_MORDEN == chain -> { - "0x3c" + "\"0x3c\"" } Chain.TESTNET_KOVAN == chain -> { - "0x2a" + "\"0x2a\"" } else -> throw RpcException(-32602, "Invalid chain") } 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 aa6240f3..8779d3d9 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy @@ -19,8 +19,8 @@ class DefaultEthereumMethodsSpec extends Specification { new String(new DefaultEthereumMethods(chain).executeHardcoded("eth_chainId")) == id where: chain | id - Chain.ETHEREUM | "0x0" - Chain.ETHEREUM_CLASSIC | "0x3d" - Chain.TESTNET_KOVAN | "0x2a" + Chain.ETHEREUM | '"0x0"' + Chain.ETHEREUM_CLASSIC | '"0x3d"' + Chain.TESTNET_KOVAN | '"0x2a"' } }