RPC Parameters to accept input and data field (#6094)

* Accept input or data as payload for RPC calls

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Add json new rpc valid and invalid request to test the changes

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Change JsonCallParameter signature to avoid duplicating constructor

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Add changelog

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

---------

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
pull/5865/merge
Gabriel Fukushima 1 year ago committed by GitHub
parent a60b31b3af
commit 6dd558b532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 13
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthCallIntegrationTest.java
  3. 8
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthCreateAccessListIntegrationTest.java
  4. 8
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthEstimateGasIntegrationTest.java
  5. 9
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/london/EthCallIntegrationTest.java
  6. 4
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/london/EthEstimateGasIntegrationTest.java
  7. 13
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/JsonCallParameter.java
  8. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java
  9. 2
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCreateAccessListTest.java
  10. 2
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthEstimateGasTest.java
  11. 14
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCallTest.java
  12. 25
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_invalidWithInputAndDataAttribute.json
  13. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_withInputAttribute.json

@ -20,6 +20,7 @@
### Additions and Improvements
- Ethereum Classic Spiral network upgrade [#6078](https://github.com/hyperledger/besu/pull/6078)
- Add a method to read from a `Memory` instance without altering its inner state [#6073](https://github.com/hyperledger/besu/pull/6073)
- Accept `input` and `data` field for the payload of transaction-related RPC methods [#6094](https://github.com/hyperledger/besu/pull/6094)
### Bug fixes

@ -74,6 +74,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -98,6 +99,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "0x8");
final JsonRpcResponse expectedResponse =
@ -123,6 +125,7 @@ public class EthCallIntegrationTest {
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -148,6 +151,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -170,6 +174,7 @@ public class EthCallIntegrationTest {
null,
null,
Bytes.fromHexString("0x12a7b914"),
null,
true,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
@ -193,6 +198,7 @@ public class EthCallIntegrationTest {
null,
null,
Bytes.fromHexString("0x12a7b914"),
null,
false,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
@ -218,6 +224,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -241,6 +248,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -265,6 +273,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -288,6 +297,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -312,6 +322,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -336,6 +347,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x12a7b914"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -360,6 +372,7 @@ public class EthCallIntegrationTest {
null,
null,
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x");

@ -140,7 +140,7 @@ public class EthCreateAccessListIntegrationTest {
@Test
public void shouldReturnExpectedValueForEmptyCallParameter() {
final JsonCallParameter callParameter =
new JsonCallParameter(null, null, null, null, null, null, null, null, null, null);
new JsonCallParameter(null, null, null, null, null, null, null, null, null, null, null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(null, new CreateAccessListResult(new ArrayList<>(), 0xcf08));
@ -163,6 +163,7 @@ public class EthCreateAccessListIntegrationTest {
Wei.ZERO,
null,
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse =
@ -187,6 +188,7 @@ public class EthCreateAccessListIntegrationTest {
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse =
@ -210,6 +212,7 @@ public class EthCreateAccessListIntegrationTest {
null,
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
false,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
@ -224,7 +227,7 @@ public class EthCreateAccessListIntegrationTest {
@Test
public void shouldReturnExpectedValueForInsufficientGas() {
final JsonCallParameter callParameter =
new JsonCallParameter(null, null, 1L, null, null, null, null, null, null, null);
new JsonCallParameter(null, null, 1L, null, null, null, null, null, null, null, null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(null, new CreateAccessListResult(new ArrayList<>(), 0xcf08));
@ -258,6 +261,7 @@ public class EthCreateAccessListIntegrationTest {
null,
null,
null,
null,
accessList);
}

@ -64,7 +64,7 @@ public class EthEstimateGasIntegrationTest {
@Test
public void shouldReturnExpectedValueForEmptyCallParameter() {
final JsonCallParameter callParameter =
new JsonCallParameter(null, null, null, null, null, null, null, null, null, null);
new JsonCallParameter(null, null, null, null, null, null, null, null, null, null, null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x5208");
@ -86,6 +86,7 @@ public class EthEstimateGasIntegrationTest {
Wei.ONE,
null,
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x5208");
@ -109,6 +110,7 @@ public class EthEstimateGasIntegrationTest {
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x1b551");
@ -131,6 +133,7 @@ public class EthEstimateGasIntegrationTest {
null,
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
false,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
@ -154,6 +157,7 @@ public class EthEstimateGasIntegrationTest {
null,
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
true,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
@ -167,7 +171,7 @@ public class EthEstimateGasIntegrationTest {
@Test
public void shouldReturnExpectedValueForInsufficientGas() {
final JsonCallParameter callParameter =
new JsonCallParameter(null, null, 1L, null, null, null, null, null, null, null);
new JsonCallParameter(null, null, 1L, null, null, null, null, null, null, null, null);
final JsonRpcRequestContext request = requestWithParams(callParameter);
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x5208");

@ -74,6 +74,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -98,6 +99,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -121,6 +123,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -145,6 +148,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -168,6 +172,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -192,6 +197,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -216,6 +222,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -239,6 +246,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
@ -263,6 +271,7 @@ public class EthCallIntegrationTest {
null,
Bytes.fromHexString("0x2e64cec1"),
null,
null,
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =

@ -77,6 +77,7 @@ public class EthEstimateGasIntegrationTest {
Wei.ONE,
null,
null,
null,
null);
final JsonRpcResponse response = method.response(requestWithParams(callParameter));
@ -98,6 +99,7 @@ public class EthEstimateGasIntegrationTest {
Wei.ONE,
null,
null,
null,
createAccessList());
final JsonRpcResponse response = method.response(requestWithParams(callParameter));
@ -119,6 +121,7 @@ public class EthEstimateGasIntegrationTest {
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
null,
null);
final JsonRpcResponse response = method.response(requestWithParams(callParameter));
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, "0x1f081");
@ -139,6 +142,7 @@ public class EthEstimateGasIntegrationTest {
Bytes.fromHexString(
"0x608060405234801561001057600080fd5b50610157806100206000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633bdab8bf146100515780639ae97baa14610068575b600080fd5b34801561005d57600080fd5b5061006661007f565b005b34801561007457600080fd5b5061007d6100b9565b005b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60016040518082815260200191505060405180910390a1565b7fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60026040518082815260200191505060405180910390a17fa53887c1eed04528e23301f55ad49a91634ef5021aa83a97d07fd16ed71c039a60036040518082815260200191505060405180910390a15600a165627a7a7230582010ddaa52e73a98c06dbcd22b234b97206c1d7ed64a7c048e10c2043a3d2309cb0029"),
null,
null,
createAccessList());
final JsonRpcResponse response = method.response(requestWithParams(callParameter));

@ -49,10 +49,12 @@ public class JsonCallParameter extends CallParameter {
@JsonProperty("maxPriorityFeePerGas") final Wei maxPriorityFeePerGas,
@JsonProperty("maxFeePerGas") final Wei maxFeePerGas,
@JsonProperty("value") final Wei value,
@JsonDeserialize(using = HexStringDeserializer.class) @JsonProperty("data")
final Bytes payload,
@JsonDeserialize(using = HexStringDeserializer.class) @JsonProperty("data") final Bytes data,
@JsonDeserialize(using = HexStringDeserializer.class) @JsonProperty("input")
final Bytes input,
@JsonProperty("strict") final Boolean strict,
@JsonProperty("accessList") final List<AccessListEntry> accessList) {
super(
from,
to,
@ -61,8 +63,13 @@ public class JsonCallParameter extends CallParameter {
Optional.ofNullable(maxPriorityFeePerGas),
Optional.ofNullable(maxFeePerGas),
value,
payload,
Optional.ofNullable(input != null ? input : data).orElse(null),
Optional.ofNullable(accessList));
if (input != null && data != null) {
throw new IllegalArgumentException("Only one of 'input' or 'data' should be provided");
}
this.strict = Optional.ofNullable(strict);
}

@ -115,7 +115,8 @@ public class EthCallTest {
@Test
public void shouldAcceptRequestWhenMissingOptionalFields() {
final JsonCallParameter callParameter =
new JsonCallParameter(null, null, null, null, null, null, null, null, Boolean.FALSE, null);
new JsonCallParameter(
null, null, null, null, null, null, null, null, null, Boolean.FALSE, null);
final JsonRpcRequestContext request = ethCallRequest(callParameter, "latest");
final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(null, Bytes.of().toString());
@ -453,6 +454,7 @@ public class EthCallTest {
Wei.ZERO,
Bytes.EMPTY,
null,
null,
null);
}

@ -308,6 +308,7 @@ public class EthCreateAccessListTest {
null,
Wei.ZERO,
Bytes.EMPTY,
null,
false,
null);
}
@ -336,6 +337,7 @@ public class EthCreateAccessListTest {
Wei.fromHexString("0x10"),
Wei.ZERO,
Bytes.EMPTY,
null,
false,
accessListEntries);
}

@ -436,6 +436,7 @@ public class EthEstimateGasTest {
null,
Wei.ZERO,
Bytes.EMPTY,
null,
isStrict,
null);
}
@ -467,6 +468,7 @@ public class EthEstimateGasTest {
Wei.fromHexString("0x10"),
Wei.ZERO,
Bytes.EMPTY,
null,
false,
null);
}

@ -85,6 +85,7 @@ public class PrivCallTest {
Wei.ZERO,
Bytes.EMPTY,
null,
null,
null);
final JsonRpcRequestContext request = ethCallRequest(privacyGroupId, callParameter, "latest");
@ -111,7 +112,17 @@ public class PrivCallTest {
public void shouldAcceptRequestWhenMissingOptionalFields() {
final JsonCallParameter callParameter =
new JsonCallParameter(
null, Address.fromHexString("0x0"), null, null, null, null, null, null, null, null);
null,
Address.fromHexString("0x0"),
null,
null,
null,
null,
null,
null,
null,
null,
null);
final JsonRpcRequestContext request = ethCallRequest(privacyGroupId, callParameter, "latest");
final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(null, Bytes.of().toString());
@ -191,6 +202,7 @@ public class PrivCallTest {
Wei.ZERO,
Bytes.EMPTY,
null,
null,
null);
}

@ -0,0 +1,25 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"input": "0x12a7b914",
"data": "0x12a7b914"
},
"0x19"
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 200
}

@ -0,0 +1,21 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"input": "0x12a7b914"
},
"0x19"
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}
Loading…
Cancel
Save