diff --git a/rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java b/rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java index 8bb6f3195cd..e91578400b4 100644 --- a/rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java +++ b/rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java @@ -281,7 +281,7 @@ public String rsk_protocolVersion() { } } - return s = Integer.toString(version); + return s = HexUtils.toQuantityJsonHex(version); } finally { if (logger.isDebugEnabled()) { logger.debug("rsk_protocolVersion(): {}", s); diff --git a/rskj-core/src/test/java/org/ethereum/rpc/Web3ImplTest.java b/rskj-core/src/test/java/org/ethereum/rpc/Web3ImplTest.java index 09281d716b5..f0e17ed66c6 100644 --- a/rskj-core/src/test/java/org/ethereum/rpc/Web3ImplTest.java +++ b/rskj-core/src/test/java/org/ethereum/rpc/Web3ImplTest.java @@ -153,7 +153,7 @@ void eth_protocolVersion() { String netVersion = web3.eth_protocolVersion(); - assertEquals(0, netVersion.compareTo("1"), "RSK net version different than one"); + assertEquals(0, netVersion.compareTo("0x1"), "RSK net version different than one"); } @Test