diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java index 8bbc1d3c05d..55ee71fde15 100644 --- a/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/AccountOverride.java @@ -14,6 +14,8 @@ */ package org.hyperledger.besu.datatypes; +import org.hyperledger.besu.datatypes.parameters.UnsignedLongParameter; + import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -21,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.apache.tuweni.bytes.Bytes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,8 +111,8 @@ public Builder withBalance(final Wei balance) { * @param nonce the nonce override in hex * @return the builder */ - public Builder withNonce(final String nonce) { - this.nonce = Optional.of(Bytes.fromHexStringLenient(nonce).toLong()); + public Builder withNonce(final UnsignedLongParameter nonce) { + this.nonce = Optional.of(nonce.getValue()); return this; } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java index 867d1619aa3..477e06f7039 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java @@ -32,6 +32,7 @@ import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.datatypes.parameters.UnsignedLongParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonCallParameter; @@ -104,7 +105,8 @@ public void noAccountOverrides() { @Test public void someAccountOverrides() { AccountOverrideMap expectedOverrides = new AccountOverrideMap(); - AccountOverride override = new AccountOverride.Builder().withNonce("0x9e").build(); + AccountOverride override = + new AccountOverride.Builder().withNonce(new UnsignedLongParameter("0x9e")).build(); final Address address = Address.fromHexString("0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3"); expectedOverrides.put(address, override); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGasTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGasTest.java index 11010202ee0..de6b74ceb0b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGasTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGasTest.java @@ -25,6 +25,7 @@ import org.hyperledger.besu.datatypes.AccountOverrideMap; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.datatypes.parameters.UnsignedLongParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; @@ -116,7 +117,8 @@ public void noAccountOverrides() { @Test public void someAccountOverrides() { AccountOverrideMap expectedOverrides = new AccountOverrideMap(); - AccountOverride override = new AccountOverride.Builder().withNonce("0x9e").build(); + AccountOverride override = + new AccountOverride.Builder().withNonce(new UnsignedLongParameter("0x9e")).build(); final Address address = Address.fromHexString("0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3"); expectedOverrides.put(address, override);