From 8cebafd219805b7182696c14a83e5fef683827b1 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Mon, 18 Sep 2023 14:06:07 -0400 Subject: [PATCH] Convert rsk_protocalVersion return value to hex --- rskj-core/src/main/java/org/ethereum/rpc/Web3Impl.java | 2 +- rskj-core/src/test/java/org/ethereum/rpc/Web3ImplTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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