Updated made to handle block parameter as an object (#1784)

* #1733 - add support for eip-1898

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1733 - update changelog

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1733 - Fix merge issues

Signed-off-by: David Mechler <david.mechler@consensys.net>

* Updated code to handle block parameter as an object; added new tests

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1733 - Update to handle new block parameter; update tests accordingly

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1733 - Updates for PR comments

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1733 - fix broken test

Signed-off-by: David Mechler <david.mechler@consensys.net>
pull/1821/head
David Mechler 4 years ago committed by GitHub
parent 77859a9a4c
commit 57cef9a70b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 1
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpService.java
  3. 119
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterOrBlockHashMethod.java
  4. 32
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCall.java
  5. 29
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBalance.java
  6. 19
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetCode.java
  7. 44
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetProof.java
  8. 23
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetStorageAt.java
  9. 20
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionCount.java
  10. 76
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterOrBlockHash.java
  11. 1
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/JsonRpcError.java
  12. 96
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
  13. 51
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTest.java
  14. 53
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthCallTest.java
  15. 54
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetProofTest.java
  16. 15
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionCountTest.java
  17. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockHash.json
  18. 23
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockHashObject.json
  19. 24
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockHashObjectCanonical.json
  20. 24
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockHashObjectCanonicalFalse.json
  21. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockNumber.json
  22. 23
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_blockNumberObject.json
  23. 24
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_invalidBlockhash.json
  24. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockHash.json
  25. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockHashObject.json
  26. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockHashObjectCanonical.json
  27. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockHashObjectCanonicalFalse.json
  28. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockNumber.json
  29. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_blockNumberObject.json
  30. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_illegalRangeGreaterThan.json
  31. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_illegalRangeLessThan.json
  32. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_invalidBlockHash.json
  33. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockHash.json
  34. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockHashObject.json
  35. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockHashObjectCanonical.json
  36. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockHashObjectCanonicalFalse.json
  37. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockNumber.json
  38. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_blockNumberObject.json
  39. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_illegalRangeGreaterThan.json
  40. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_illegalRangeLessThan.json
  41. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_invalidBlockHash.json
  42. 30
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockHash.json
  43. 32
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockHashObject.json
  44. 33
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockHashObjectCanonical.json
  45. 33
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockHashObjectCanonicalFalse.json
  46. 30
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockNumber.json
  47. 32
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_blockNumberObject.json
  48. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_illegalRangeGreaterThan.json
  49. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_illegalRangeLessThan.json
  50. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_invalidBlockHash.json
  51. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_invalidParams.json
  52. 30
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_latest.json
  53. 30
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_pending.json
  54. 18
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockHash.json
  55. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockHashObject.json
  56. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockHashObjectCanonical.json
  57. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockHashObjectCanonicalFalse.json
  58. 18
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockNumber.json
  59. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_blockNumberObject.json
  60. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_illegalRangeGreaterThan.json
  61. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_illegalRangeLessThan.json
  62. 21
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_invalidBlockHash.json
  63. 17
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_blockHash.json
  64. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_blockHashObject.json
  65. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_blockHashObjectCanonical.json
  66. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_blockHashObjectCanonicalFalse.json
  67. 19
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_blockNumberObject.json
  68. 7
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_illegalRange.json
  69. 20
      ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_invalidBlockHash.json

@ -25,6 +25,7 @@
* Implemented [EIP-868](https://eips.ethereum.org/EIPS/eip-868): Node Discovery v4 ENR Extension [\#1721](https://github.com/hyperledger/besu/pull/1721)
* Added revert reason to eth_estimateGas RPC call. [\#1730](https://github.com/hyperledger/besu/pull/1730)
* Added command line option --static-nodes-file. [#1644](https://github.com/hyperledger/besu/pull/1644)
* Implemented [EIP-1898](https://eips.ethereum.org/EIPS/eip-1898): Add `blockHash` to JSON-RPC methods which accept a default block parameter [\#1757](https://github.com/hyperledger/besu/pull/1757)
### Bug Fixes
* Accept locally-sourced transactions below the minimum gas price. [#1480](https://github.com/hyperledger/besu/issues/1480) [#1743](https://github.com/hyperledger/besu/pull/1743)

@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Streams.stream;
import static java.util.stream.Collectors.toList;
import static org.apache.tuweni.net.tls.VertxTrustOptions.whitelistClients;
import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError.INVALID_PARAMS;
import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError.INVALID_REQUEST;
import org.hyperledger.besu.ethereum.api.handlers.HandlerFactory;

@ -0,0 +1,119 @@
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Hash;
import java.util.Optional;
import java.util.OptionalLong;
import java.util.function.Supplier;
import com.google.common.base.Suppliers;
public abstract class AbstractBlockParameterOrBlockHashMethod implements JsonRpcMethod {
protected final Supplier<BlockchainQueries> blockchainQueries;
protected AbstractBlockParameterOrBlockHashMethod(final BlockchainQueries blockchainQueries) {
this(Suppliers.ofInstance(blockchainQueries));
}
protected AbstractBlockParameterOrBlockHashMethod(
final Supplier<BlockchainQueries> blockchainQueries) {
this.blockchainQueries = blockchainQueries;
}
protected abstract BlockParameterOrBlockHash blockParameterOrBlockHash(
JsonRpcRequestContext request);
protected abstract Object resultByBlockHash(JsonRpcRequestContext request, Hash blockHash);
protected BlockchainQueries getBlockchainQueries() {
return blockchainQueries.get();
}
protected Object pendingResult(final JsonRpcRequestContext request) {
// TODO: Update once we mine and better understand pending semantics.
// For now act like we are not mining and just return latest.
return latestResult(request);
}
protected Object latestResult(final JsonRpcRequestContext request) {
return resultByBlockHash(
request, getBlockchainQueries().getBlockchain().getChainHead().getHash());
}
protected Object handleParamTypes(final JsonRpcRequestContext requestContext) {
final BlockParameterOrBlockHash blockParameterOrBlockHash =
blockParameterOrBlockHash(requestContext);
final Object result;
if (blockParameterOrBlockHash.isLatest()) {
result = latestResult(requestContext);
} else if (blockParameterOrBlockHash.isPending()) {
result = pendingResult(requestContext);
} else if (blockParameterOrBlockHash.isNumeric() || blockParameterOrBlockHash.isEarliest()) {
OptionalLong blockNumber = blockParameterOrBlockHash.getNumber();
if (blockNumber.isEmpty()
|| blockNumber.getAsLong() < 0
|| blockNumber.getAsLong() > getBlockchainQueries().headBlockNumber()) {
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), JsonRpcError.INVALID_PARAMS);
}
result =
resultByBlockHash(
requestContext,
blockchainQueries
.get()
.getBlockHashByNumber(blockNumber.getAsLong())
.orElse(Hash.EMPTY));
} else {
Optional<Hash> blockHash = blockParameterOrBlockHash.getHash();
if (blockHash.isEmpty()) {
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), JsonRpcError.INVALID_PARAMS);
}
if (Boolean.TRUE.equals(blockParameterOrBlockHash.getRequireCanonical())
&& !getBlockchainQueries().blockIsOnCanonicalChain(blockHash.get())) {
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), JsonRpcError.JSON_RPC_NOT_CANONICAL_ERROR);
}
result = resultByBlockHash(requestContext, blockHash.get());
}
return result;
}
@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
Object response = handleParamTypes(requestContext);
if (response instanceof JsonRpcErrorResponse) {
return (JsonRpcResponse) response;
}
return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), response);
}
}

@ -18,18 +18,16 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcErrorConverter;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonCallParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.transaction.TransactionSimulator;
import org.hyperledger.besu.ethereum.vm.OperationTracer;
public class EthCall extends AbstractBlockParameterMethod {
public class EthCall extends AbstractBlockParameterOrBlockHashMethod {
private final TransactionSimulator transactionSimulator;
public EthCall(
@ -44,21 +42,17 @@ public class EthCall extends AbstractBlockParameterMethod {
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameterOrBlockHash.class);
}
@Override
protected Object resultByBlockNumber(
final JsonRpcRequestContext request, final long blockNumber) {
protected Object resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {
final JsonCallParameter callParams = validateAndGetCallParams(request);
return transactionSimulator
.process(
callParams,
TransactionValidationParams.transactionSimulator(),
OperationTracer.NO_TRACING,
blockNumber)
.process(callParams, blockHash)
.map(
result ->
result
@ -74,13 +68,13 @@ public class EthCall extends AbstractBlockParameterMethod {
.orElse(validRequestBlockNotFound(request));
}
private JsonRpcSuccessResponse validRequestBlockNotFound(final JsonRpcRequestContext request) {
return new JsonRpcSuccessResponse(request.getRequest().getId(), null);
}
@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
return (JsonRpcResponse) findResultByParamType(requestContext);
return (JsonRpcResponse) handleParamTypes(requestContext);
}
private JsonRpcSuccessResponse validRequestBlockNotFound(final JsonRpcRequestContext request) {
return new JsonRpcSuccessResponse(request.getRequest().getId(), null);
}
private JsonCallParameter validateAndGetCallParams(final JsonRpcRequestContext request) {

@ -16,23 +16,21 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import java.util.function.Supplier;
import com.google.common.base.Suppliers;
public class EthGetBalance extends AbstractBlockParameterMethod {
public EthGetBalance(final BlockchainQueries blockchain) {
this(Suppliers.ofInstance(blockchain));
public class EthGetBalance extends AbstractBlockParameterOrBlockHashMethod {
public EthGetBalance(final BlockchainQueries blockchainQueries) {
super(blockchainQueries);
}
public EthGetBalance(final Supplier<BlockchainQueries> blockchain) {
super(blockchain);
public EthGetBalance(final Supplier<BlockchainQueries> blockchainQueries) {
super(blockchainQueries);
}
@Override
@ -41,16 +39,17 @@ public class EthGetBalance extends AbstractBlockParameterMethod {
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameterOrBlockHash.class);
}
@Override
protected String resultByBlockNumber(
final JsonRpcRequestContext request, final long blockNumber) {
protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {
final Address address = request.getRequiredParameter(0, Address.class);
return getBlockchainQueries()
.accountBalance(address, blockNumber)
return blockchainQueries
.get()
.accountBalance(address, blockHash)
.map(Quantity::create)
.orElse(null);
}

@ -16,19 +16,18 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import java.util.function.Supplier;
import com.google.common.base.Suppliers;
import org.apache.tuweni.bytes.Bytes;
public class EthGetCode extends AbstractBlockParameterMethod {
public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {
public EthGetCode(final BlockchainQueries blockchainQueries) {
super(Suppliers.ofInstance(blockchainQueries));
super(blockchainQueries);
}
public EthGetCode(final Supplier<BlockchainQueries> blockchainQueries) {
@ -41,14 +40,14 @@ public class EthGetCode extends AbstractBlockParameterMethod {
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameterOrBlockHash.class);
}
@Override
protected String resultByBlockNumber(
final JsonRpcRequestContext request, final long blockNumber) {
protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {
final Address address = request.getRequiredParameter(0, Address.class);
return getBlockchainQueries().getCode(address, blockNumber).map(Bytes::toString).orElse(null);
return getBlockchainQueries().getCode(address, blockHash).map(Bytes::toString).orElse(null);
}
}

@ -16,7 +16,7 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
@ -24,6 +24,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSucces
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.proof.GetProofResult;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.core.WorldState;
import org.hyperledger.besu.ethereum.proof.WorldStateProof;
@ -34,42 +35,34 @@ import java.util.stream.Collectors;
import org.apache.tuweni.units.bigints.UInt256;
public class EthGetProof extends AbstractBlockParameterMethod {
private final BlockchainQueries blockchain;
public class EthGetProof extends AbstractBlockParameterOrBlockHashMethod {
public EthGetProof(final BlockchainQueries blockchain) {
super(blockchain);
this.blockchain = blockchain;
}
private Address getAddress(final JsonRpcRequestContext request) {
return request.getRequiredParameter(0, Address.class);
}
private List<UInt256> getStorageKeys(final JsonRpcRequestContext request) {
return Arrays.stream(request.getRequiredParameter(1, String[].class))
.map(UInt256::fromHexString)
.collect(Collectors.toList());
@Override
public String getName() {
return RpcMethod.ETH_GET_PROOF.getMethodName();
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(2, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(2, BlockParameterOrBlockHash.class);
}
@Override
protected Object resultByBlockNumber(
final JsonRpcRequestContext requestContext, final long blockNumber) {
protected Object resultByBlockHash(
final JsonRpcRequestContext requestContext, final Hash blockHash) {
final Address address = getAddress(requestContext);
final Address address = requestContext.getRequiredParameter(0, Address.class);
final List<UInt256> storageKeys = getStorageKeys(requestContext);
final Optional<WorldState> worldState = blockchain.getWorldState(blockNumber);
final Optional<WorldState> worldState = getBlockchainQueries().getWorldState(blockHash);
if (worldState.isPresent()) {
Optional<WorldStateProof> proofOptional =
blockchain
getBlockchainQueries()
.getWorldStateArchive()
.getAccountProof(worldState.get().rootHash(), address, storageKeys);
return proofOptional
@ -90,11 +83,12 @@ public class EthGetProof extends AbstractBlockParameterMethod {
@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
return (JsonRpcResponse) findResultByParamType(requestContext);
return (JsonRpcResponse) handleParamTypes(requestContext);
}
@Override
public String getName() {
return RpcMethod.ETH_GET_PROOF.getMethodName();
private List<UInt256> getStorageKeys(final JsonRpcRequestContext request) {
return Arrays.stream(request.getRequiredParameter(1, String[].class))
.map(UInt256::fromHexString)
.collect(Collectors.toList());
}
}

@ -16,17 +16,17 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.UInt256Parameter;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import org.apache.tuweni.units.bigints.UInt256;
public class EthGetStorageAt extends AbstractBlockParameterMethod {
public EthGetStorageAt(final BlockchainQueries blockchain) {
super(blockchain);
public class EthGetStorageAt extends AbstractBlockParameterOrBlockHashMethod {
public EthGetStorageAt(final BlockchainQueries blockchainQueries) {
super(blockchainQueries);
}
@Override
@ -35,17 +35,18 @@ public class EthGetStorageAt extends AbstractBlockParameterMethod {
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(2, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(2, BlockParameterOrBlockHash.class);
}
@Override
protected String resultByBlockNumber(
final JsonRpcRequestContext request, final long blockNumber) {
protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {
final Address address = request.getRequiredParameter(0, Address.class);
final UInt256 position = request.getRequiredParameter(1, UInt256Parameter.class).getValue();
return getBlockchainQueries()
.storageAt(address, position, blockNumber)
return blockchainQueries
.get()
.storageAt(address, position, blockHash)
.map(UInt256::toHexString)
.orElse(null);
}

@ -16,10 +16,11 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameterOrBlockHash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.eth.transactions.PendingTransactions;
import java.util.OptionalLong;
@ -27,8 +28,7 @@ import java.util.function.Supplier;
import com.google.common.base.Suppliers;
public class EthGetTransactionCount extends AbstractBlockParameterMethod {
public class EthGetTransactionCount extends AbstractBlockParameterOrBlockHashMethod {
private final Supplier<PendingTransactions> pendingTransactions;
private final boolean resultAsDecimal;
@ -52,8 +52,9 @@ public class EthGetTransactionCount extends AbstractBlockParameterMethod {
}
@Override
protected BlockParameter blockParameter(final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameter.class);
protected BlockParameterOrBlockHash blockParameterOrBlockHash(
final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, BlockParameterOrBlockHash.class);
}
@Override
@ -68,13 +69,10 @@ public class EthGetTransactionCount extends AbstractBlockParameterMethod {
}
@Override
protected String resultByBlockNumber(
final JsonRpcRequestContext request, final long blockNumber) {
protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {
final Address address = request.getRequiredParameter(0, Address.class);
if (blockNumber > getBlockchainQueries().headBlockNumber()) {
return null;
}
final long transactionCount = getBlockchainQueries().getTransactionCount(address, blockNumber);
final long transactionCount = getBlockchainQueries().getTransactionCount(address, blockHash);
return resultAsDecimal ? Long.toString(transactionCount) : Quantity.create(transactionCount);
}
}

@ -14,6 +14,7 @@
*/
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters;
import org.hyperledger.besu.config.JsonUtil;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Hash;
@ -22,6 +23,8 @@ import java.util.Optional;
import java.util.OptionalLong;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
/**
* Represents a block parameter that can be a special value ("pending", "earliest", "latest") or a
@ -36,31 +39,56 @@ public class BlockParameterOrBlockHash {
private final BlockParameterType type;
private final OptionalLong number;
private final Optional<Hash> blockHash;
private final boolean requireCanonical;
@JsonCreator
public BlockParameterOrBlockHash(final String value) {
final String normalizedValue = value.toLowerCase();
if (Objects.equals(normalizedValue, "earliest")) {
type = BlockParameterType.EARLIEST;
number = OptionalLong.of(BlockHeader.GENESIS_BLOCK_NUMBER);
blockHash = Optional.empty();
} else if (Objects.equals(normalizedValue, "latest")) {
type = BlockParameterType.LATEST;
number = OptionalLong.empty();
blockHash = Optional.empty();
} else if (Objects.equals(normalizedValue, "pending")) {
type = BlockParameterType.PENDING;
number = OptionalLong.empty();
blockHash = Optional.empty();
} else if (normalizedValue.length() > 16) {
type = BlockParameterType.HASH;
number = OptionalLong.empty();
blockHash = Optional.of(Hash.fromHexStringLenient(normalizedValue));
public BlockParameterOrBlockHash(final Object value) throws JsonProcessingException {
if (value instanceof String) {
final String normalizedValue = String.valueOf(value).toLowerCase();
if (Objects.equals(normalizedValue, "earliest")) {
type = BlockParameterType.EARLIEST;
number = OptionalLong.of(BlockHeader.GENESIS_BLOCK_NUMBER);
blockHash = Optional.empty();
requireCanonical = false;
} else if (Objects.equals(normalizedValue, "latest")) {
type = BlockParameterType.LATEST;
number = OptionalLong.empty();
blockHash = Optional.empty();
requireCanonical = false;
} else if (Objects.equals(normalizedValue, "pending")) {
type = BlockParameterType.PENDING;
number = OptionalLong.empty();
blockHash = Optional.empty();
requireCanonical = false;
} else if (normalizedValue.length() > 16) {
type = BlockParameterType.HASH;
number = OptionalLong.empty();
blockHash = Optional.of(Hash.fromHexStringLenient(normalizedValue));
requireCanonical = false;
} else {
type = BlockParameterType.NUMERIC;
number = OptionalLong.of(Long.decode(value.toString()));
blockHash = Optional.empty();
requireCanonical = false;
}
} else {
type = BlockParameterType.NUMERIC;
number = OptionalLong.of(Long.decode(value));
blockHash = Optional.empty();
JsonNode jsonNode = JsonUtil.objectNodeFromString(JsonUtil.getJson(value));
if (jsonNode.get("blockHash") != null) {
type = BlockParameterType.HASH;
number = OptionalLong.empty();
blockHash = Optional.of(Hash.fromHexStringLenient(jsonNode.get("blockHash").asText()));
if (jsonNode.get("requireCanonical") != null) {
requireCanonical = jsonNode.get("requireCanonical").asBoolean();
} else {
requireCanonical = false;
}
} else {
type = BlockParameterType.NUMERIC;
number = OptionalLong.of(Long.decode(jsonNode.get("blockNumber").asText()));
blockHash = Optional.empty();
requireCanonical = false;
}
}
}
@ -72,6 +100,10 @@ public class BlockParameterOrBlockHash {
return blockHash;
}
public boolean getRequireCanonical() {
return requireCanonical;
}
public boolean isPending() {
return this.type == BlockParameterType.PENDING;
}

@ -147,6 +147,7 @@ public enum JsonRpcError {
ENODE_ID_INVALID(
-32000,
"Invalid node ID: node ID must have exactly 128 hexadecimal characters and should not include any '0x' hex prefix."),
JSON_RPC_NOT_CANONICAL_ERROR(-32000, "Invalid input"),
// Enclave errors
NODE_MISSING_PEER_URL(-50200, "NodeMissingPeerUrl"),

@ -150,8 +150,24 @@ public class BlockchainQueries {
*/
public Optional<UInt256> storageAt(
final Address address, final UInt256 storageIndex, final long blockNumber) {
final Hash blockHash =
getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
return storageAt(address, storageIndex, blockHash);
}
/**
* Determines the block header for the address associated with this storage index.
*
* @param address The address of the account that owns the storage being queried.
* @param storageIndex The storage index whose value is being retrieved.
* @param blockHash The blockHash that is being queried.
* @return The value at the storage index being queried.
*/
public Optional<UInt256> storageAt(
final Address address, final UInt256 storageIndex, final Hash blockHash) {
return fromAccount(
address, blockNumber, account -> account.getStorageValue(storageIndex), UInt256.ZERO);
address, blockHash, account -> account.getStorageValue(storageIndex), UInt256.ZERO);
}
/**
@ -162,7 +178,21 @@ public class BlockchainQueries {
* @return The balance of the account in Wei.
*/
public Optional<Wei> accountBalance(final Address address, final long blockNumber) {
return fromAccount(address, blockNumber, Account::getBalance, Wei.ZERO);
final Hash blockHash =
getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
return accountBalance(address, blockHash);
}
/**
* Returns the balance of the given account at a specific block hash.
*
* @param address The address of the account being queried.
* @param blockHash The block hash being queried.
* @return The balance of the account in Wei.
*/
public Optional<Wei> accountBalance(final Address address, final Hash blockHash) {
return fromAccount(address, blockHash, Account::getBalance, Wei.ZERO);
}
/**
@ -173,7 +203,21 @@ public class BlockchainQueries {
* @return The code associated with this address.
*/
public Optional<Bytes> getCode(final Address address, final long blockNumber) {
return fromAccount(address, blockNumber, Account::getCode, Bytes.EMPTY);
final Hash blockHash =
getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
return getCode(address, blockHash);
}
/**
* Retrieves the code associated with the given account at a particular block hash.
*
* @param address The account address being queried.
* @param blockHash The hash of the block to be checked.
* @return The code associated with this address.
*/
public Optional<Bytes> getCode(final Address address, final Hash blockHash) {
return fromAccount(address, blockHash, Account::getCode, Bytes.EMPTY);
}
/**
@ -217,7 +261,21 @@ public class BlockchainQueries {
* @return The number of transactions sent from the given address.
*/
public long getTransactionCount(final Address address, final long blockNumber) {
return getWorldState(blockNumber)
final Hash blockHash =
getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
return getTransactionCount(address, blockHash);
}
/**
* Returns the number of transactions sent from the given address in the block at the given hash.
*
* @param address The address whose sent transactions we want to count.
* @param blockHash The hash of the block being queried.
* @return The number of transactions sent from the given address.
*/
public long getTransactionCount(final Address address, final Hash blockHash) {
return getWorldState(blockHash)
.map(worldState -> worldState.get(address))
.map(Account::getNonce)
.orElse(0L);
@ -324,7 +382,7 @@ public class BlockchainQueries {
blockchain
.getTotalDifficultyByHash(blockHeaderHash)
.map(
(td) -> {
td -> {
final List<Transaction> txs = body.getTransactions();
final List<TransactionWithMetadata> formattedTxs =
formatTransactions(
@ -379,7 +437,7 @@ public class BlockchainQueries {
blockchain
.getTotalDifficultyByHash(blockHeaderHash)
.map(
(td) -> {
td -> {
final List<Hash> txs =
body.getTransactions().stream()
.map(Transaction::getHash)
@ -728,7 +786,20 @@ public class BlockchainQueries {
* @return the world state at the block number
*/
public Optional<WorldState> getWorldState(final long blockNumber) {
final Optional<BlockHeader> header = blockchain.getBlockHeader(blockNumber);
final Hash blockHash =
getBlockHeaderByNumber(blockNumber).map(BlockHeader::getHash).orElse(Hash.EMPTY);
return getWorldState(blockHash);
}
/**
* Returns the world state for the corresponding block hash
*
* @param blockHash the block hash
* @return the world state at the block hash
*/
public Optional<WorldState> getWorldState(final Hash blockHash) {
final Optional<BlockHeader> header = blockchain.getBlockHeader(blockHash);
return header.flatMap(
blockHeader ->
worldStateArchive.getMutable(blockHeader.getStateRoot(), blockHeader.getHash()));
@ -764,20 +835,17 @@ public class BlockchainQueries {
}
private <T> Optional<T> fromWorldState(
final long blockNumber, final Function<WorldState, T> getter) {
if (outsideBlockchainRange(blockNumber)) {
return Optional.empty();
}
return getWorldState(blockNumber).map(getter);
final Hash blockHash, final Function<WorldState, T> getter) {
return getWorldState(blockHash).map(getter);
}
private <T> Optional<T> fromAccount(
final Address address,
final long blockNumber,
final Hash blockHash,
final Function<Account, T> getter,
final T noAccountValue) {
return fromWorldState(
blockNumber,
blockHash,
worldState ->
Optional.ofNullable(worldState.get(address)).map(getter).orElse(noAccountValue));
}

@ -35,6 +35,8 @@ import org.hyperledger.besu.ethereum.api.query.BlockWithMetadata;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.api.query.TransactionWithMetadata;
import org.hyperledger.besu.ethereum.blockcreation.EthHashMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
@ -106,7 +108,9 @@ public class JsonRpcHttpServiceTest {
protected static final BigInteger CHAIN_ID = BigInteger.valueOf(123);
protected static P2PNetwork peerDiscoveryMock;
protected static EthPeers ethPeersMock;
protected static Blockchain blockchain;
protected static BlockchainQueries blockchainQueries;
protected static ChainHead chainHead;
protected static Synchronizer synchronizer;
protected static final Collection<RpcApi> JSON_RPC_APIS =
Arrays.asList(RpcApis.ETH, RpcApis.NET, RpcApis.WEB3, RpcApis.ADMIN);
@ -117,7 +121,9 @@ public class JsonRpcHttpServiceTest {
public static void initServerAndClient() throws Exception {
peerDiscoveryMock = mock(P2PNetwork.class);
ethPeersMock = mock(EthPeers.class);
blockchain = mock(Blockchain.class);
blockchainQueries = mock(BlockchainQueries.class);
chainHead = mock(ChainHead.class);
synchronizer = mock(Synchronizer.class);
final Set<Capability> supportedCapabilities = new HashSet<>();
@ -552,6 +558,10 @@ public class JsonRpcHttpServiceTest {
@Test
public void ethGetUncleCountByBlockNumberPending() throws Exception {
final int uncleCount = 0;
when(blockchainQueries.headBlockNumber()).thenReturn(0L);
when(blockchainQueries.getOmmerCount(eq(0L))).thenReturn(Optional.of(uncleCount));
final String id = "123";
final String params = "\"params\": [\"pending\"]";
final RequestBody body =
@ -624,8 +634,10 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockBalance = "0x35";
when(blockchainQueries.headBlockNumber()).thenReturn(0L);
when(blockchainQueries.accountBalance(eq(address), eq(0L)))
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(blockchainQueries.accountBalance(eq(address), eq(Hash.ZERO)))
.thenReturn(Optional.of(Wei.fromHexString(mockBalance)));
final String id = "123";
@ -656,8 +668,10 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final Wei mockBalance = Wei.of(0);
when(blockchainQueries.headBlockNumber()).thenReturn(0L);
when(blockchainQueries.accountBalance(eq(address), eq(0L)))
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(blockchainQueries.accountBalance(eq(address), eq(Hash.ZERO)))
.thenReturn(Optional.of(mockBalance));
final String id = "123";
@ -688,7 +702,9 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockBalance = "0x33";
when(blockchainQueries.accountBalance(eq(address), eq(0L)))
final Hash blockHash =
Hash.fromHexString("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
when(blockchainQueries.accountBalance(eq(address), eq(blockHash)))
.thenReturn(Optional.of(Wei.fromHexString(mockBalance)));
final String id = "123";
@ -720,7 +736,10 @@ public class JsonRpcHttpServiceTest {
final Address address = gen.address();
final String mockBalance = "0x32";
final long blockNumber = 13L;
when(blockchainQueries.accountBalance(eq(address), eq(blockNumber)))
final Hash blockHash =
Hash.fromHexString("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
when(blockchainQueries.headBlockNumber()).thenReturn(21L);
when(blockchainQueries.accountBalance(eq(address), eq(blockHash)))
.thenReturn(Optional.of(Wei.fromHexString(mockBalance)));
final String id = "123";
@ -1948,8 +1967,10 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockStorage = "0x0000000000000000000000000000000000000000000000000000000000000001";
when(blockchainQueries.headBlockNumber()).thenReturn(0L);
when(blockchainQueries.storageAt(eq(address), eq(UInt256.ZERO), eq(0L)))
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(blockchainQueries.storageAt(eq(address), eq(UInt256.ZERO), eq(Hash.ZERO)))
.thenReturn(Optional.of(UInt256.fromHexString(mockStorage)));
final String id = "88";
@ -1983,8 +2004,10 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockStorage = "0x0000000000000000000000000000000000000000000000000000000000000006";
when(blockchainQueries.headBlockNumber()).thenReturn(0L);
when(blockchainQueries.storageAt(eq(address), eq(UInt256.ONE), eq(0L)))
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(blockchainQueries.storageAt(eq(address), eq(UInt256.ONE), eq(Hash.ZERO)))
.thenReturn(Optional.of(UInt256.fromHexString(mockStorage)));
final String id = "88";
@ -2018,7 +2041,9 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockStorage = "0x0000000000000000000000000000000000000000000000000000000000000006";
when(blockchainQueries.storageAt(address, UInt256.ONE, 0L))
final Hash blockHash =
Hash.fromHexString("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
when(blockchainQueries.storageAt(address, UInt256.ONE, blockHash))
.thenReturn(Optional.of(UInt256.fromHexString(mockStorage)));
final String id = "88";
@ -2052,7 +2077,9 @@ public class JsonRpcHttpServiceTest {
final BlockDataGenerator gen = new BlockDataGenerator();
final Address address = gen.address();
final String mockStorage = "0x0000000000000000000000000000000000000000000000000000000000000002";
when(blockchainQueries.storageAt(address, UInt256.ZERO, 0L))
final Hash blockHash =
Hash.fromHexString("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
when(blockchainQueries.storageAt(address, UInt256.ZERO, blockHash))
.thenReturn(Optional.of(UInt256.fromHexString(mockStorage)));
final String id = "999";

@ -31,8 +31,11 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcRespon
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Gas;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.ethereum.transaction.CallParameter;
@ -53,6 +56,8 @@ public class EthCallTest {
private EthCall method;
@Mock private Blockchain blockchain;
@Mock ChainHead chainHead;
@Mock private BlockchainQueries blockchainQueries;
@Mock private TransactionSimulator transactionSimulator;
@ -80,6 +85,9 @@ public class EthCallTest {
Bytes.EMPTY,
null);
final JsonRpcRequestContext request = ethCallRequest(callParameter, "latest");
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
final Throwable thrown = catchThrowable(() -> method.response(request));
@ -94,12 +102,15 @@ public class EthCallTest {
final JsonRpcRequestContext request = ethCallRequest(callParameter(), "latest");
final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(null, null);
when(transactionSimulator.process(any(), any(), any(), anyLong())).thenReturn(Optional.empty());
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(transactionSimulator.process(any(), any())).thenReturn(Optional.empty());
final JsonRpcResponse response = method.response(request);
assertThat(response).isEqualToComparingFieldByField(expectedResponse);
verify(transactionSimulator).process(any(), any(), any(), anyLong());
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
verify(transactionSimulator).process(any(), any());
}
@Test
@ -112,11 +123,14 @@ public class EthCallTest {
new JsonRpcSuccessResponse(null, Bytes.of().toString());
mockTransactionProcessorSuccessResult(Bytes.of());
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
final JsonRpcResponse response = method.response(request);
assertThat(response).isEqualToComparingFieldByFieldRecursively(expectedResponse);
verify(transactionSimulator).process(eq(callParameter), any(), any(), anyLong());
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
verify(transactionSimulator).process(eq(callParameter), any());
}
@Test
@ -125,41 +139,49 @@ public class EthCallTest {
final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(null, Bytes.of(1).toString());
mockTransactionProcessorSuccessResult(Bytes.of(1));
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
final JsonRpcResponse response = method.response(request);
assertThat(response).isEqualToComparingFieldByFieldRecursively(expectedResponse);
verify(transactionSimulator).process(eq(callParameter()), any(), any(), anyLong());
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
verify(transactionSimulator).process(eq(callParameter()), any());
}
@Test
public void shouldUseCorrectBlockNumberWhenLatest() {
final JsonRpcRequestContext request = ethCallRequest(callParameter(), "latest");
when(blockchainQueries.headBlockNumber()).thenReturn(11L);
when(transactionSimulator.process(any(), any(), any(), anyLong())).thenReturn(Optional.empty());
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(transactionSimulator.process(any(), any())).thenReturn(Optional.empty());
method.response(request);
verify(transactionSimulator).process(any(), any(), any(), eq(11L));
verify(transactionSimulator).process(any(), eq(Hash.ZERO));
}
@Test
public void shouldUseCorrectBlockNumberWhenEarliest() {
final JsonRpcRequestContext request = ethCallRequest(callParameter(), "earliest");
when(transactionSimulator.process(any(), any(), any(), anyLong())).thenReturn(Optional.empty());
when(blockchainQueries.getBlockHashByNumber(anyLong())).thenReturn(Optional.of(Hash.ZERO));
when(transactionSimulator.process(any(), any())).thenReturn(Optional.empty());
method.response(request);
verify(transactionSimulator).process(any(), any(), any(), eq(0L));
verify(transactionSimulator).process(any(), eq(Hash.ZERO));
}
@Test
public void shouldUseCorrectBlockNumberWhenSpecified() {
final JsonRpcRequestContext request = ethCallRequest(callParameter(), Quantity.create(13L));
when(transactionSimulator.process(any(), any(), any(), anyLong())).thenReturn(Optional.empty());
when(blockchainQueries.headBlockNumber()).thenReturn(14L);
when(blockchainQueries.getBlockHashByNumber(anyLong())).thenReturn(Optional.of(Hash.ZERO));
when(transactionSimulator.process(any(), any())).thenReturn(Optional.empty());
method.response(request);
verify(transactionSimulator).process(any(), any(), any(), eq(13L));
verify(transactionSimulator).process(any(), eq(Hash.ZERO));
}
private JsonCallParameter callParameter() {
@ -186,7 +208,6 @@ public class EthCallTest {
when(result.getValidationResult()).thenReturn(ValidationResult.valid());
when(result.getOutput()).thenReturn(output);
when(transactionSimulator.process(any(), any(), any(), anyLong()))
.thenReturn(Optional.of(result));
when(transactionSimulator.process(any(), any())).thenReturn(Optional.of(result));
}
}

@ -15,6 +15,7 @@
package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
@ -28,6 +29,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorR
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.proof.GetProofResult;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
@ -41,20 +44,18 @@ import java.util.Optional;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.units.bigints.UInt256;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class EthGetProofTest {
@Rule public final ExpectedException thrown = ExpectedException.none();
@Mock private Blockchain blockchain;
@Mock private BlockchainQueries blockchainQueries;
@Mock private ChainHead chainHead;
private EthGetProof method;
private final String JSON_RPC_VERSION = "2.0";
@ -79,31 +80,34 @@ public class EthGetProofTest {
@Test
public void errorWhenNoAddressAccountSupplied() {
final JsonRpcRequestContext request = requestWithParams(null, null, "latest");
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
thrown.expect(InvalidJsonRpcParameters.class);
thrown.expectMessage("Missing required json rpc parameter at index 0");
method.response(request);
Assertions.assertThatThrownBy(() -> method.response(request))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessageContaining("Missing required json rpc parameter at index 0");
}
@Test
public void errorWhenNoStorageKeysSupplied() {
final JsonRpcRequestContext request = requestWithParams(address.toString(), null, "latest");
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
thrown.expect(InvalidJsonRpcParameters.class);
thrown.expectMessage("Missing required json rpc parameter at index 1");
method.response(request);
Assertions.assertThatThrownBy(() -> method.response(request))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessageContaining("Missing required json rpc parameter at index 1");
}
@Test
public void errorWhenNoBlockNumberSupplied() {
final JsonRpcRequestContext request = requestWithParams(address.toString(), new String[] {});
thrown.expect(InvalidJsonRpcParameters.class);
thrown.expectMessage("Missing required json rpc parameter at index 2");
method.response(request);
Assertions.assertThatThrownBy(() -> method.response(request))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessageContaining("Missing required json rpc parameter at index 2");
}
@Test
@ -114,6 +118,8 @@ public class EthGetProofTest {
final JsonRpcErrorResponse expectedResponse =
new JsonRpcErrorResponse(null, JsonRpcError.NO_ACCOUNT_FOUND);
when(blockchainQueries.headBlockNumber()).thenReturn(14L);
final JsonRpcRequestContext request =
requestWithParams(
Address.fromHexString("0x0000000000000000000000000000000000000000"),
@ -122,13 +128,14 @@ public class EthGetProofTest {
final JsonRpcErrorResponse response = (JsonRpcErrorResponse) method.response(request);
assertThat(response).isEqualToComparingFieldByField(expectedResponse);
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
}
@Test
public void errorWhenWorldStateUnavailable() {
when(blockchainQueries.getWorldState(blockNumber)).thenReturn(Optional.empty());
when(blockchainQueries.headBlockNumber()).thenReturn(14L);
when(blockchainQueries.getWorldState(any())).thenReturn(Optional.empty());
final JsonRpcErrorResponse expectedResponse =
new JsonRpcErrorResponse(null, JsonRpcError.WORLD_STATE_UNAVAILABLE);
@ -141,7 +148,7 @@ public class EthGetProofTest {
final JsonRpcErrorResponse response = (JsonRpcErrorResponse) method.response(request);
assertThat(response).isEqualToComparingFieldByField(expectedResponse);
assertThat(response).usingRecursiveComparison().isEqualTo(expectedResponse);
}
@Test
@ -149,20 +156,21 @@ public class EthGetProofTest {
final GetProofResult expectedResponse = generateWorldState();
when(blockchainQueries.headBlockNumber()).thenReturn(14L);
final JsonRpcRequestContext request =
requestWithParams(
address.toString(), new String[] {storageKey.toString()}, String.valueOf(blockNumber));
final JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) method.response(request);
assertThat(response.getResult()).isEqualToComparingFieldByFieldRecursively(expectedResponse);
assertThat(response.getResult()).usingRecursiveComparison().isEqualTo(expectedResponse);
}
private JsonRpcRequestContext requestWithParams(final Object... params) {
return new JsonRpcRequestContext(new JsonRpcRequest(JSON_RPC_VERSION, ETH_METHOD, params));
}
@SuppressWarnings("unchecked")
private GetProofResult generateWorldState() {
final Wei balance = Wei.of(1);
@ -204,7 +212,7 @@ public class EthGetProofTest {
final MutableWorldState mutableWorldState = mock(MutableWorldState.class);
when(mutableWorldState.rootHash()).thenReturn(rootHash);
when(blockchainQueries.getWorldState(blockNumber)).thenReturn(Optional.of(mutableWorldState));
when(blockchainQueries.getWorldState(any())).thenReturn(Optional.of(mutableWorldState));
return GetProofResult.buildGetProofResult(address, worldStateProof);
}

@ -22,7 +22,10 @@ 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.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.eth.transactions.PendingTransactions;
import java.util.OptionalLong;
@ -31,11 +34,13 @@ import org.junit.Test;
public class EthGetTransactionCountTest {
private final BlockchainQueries blockchain = mock(BlockchainQueries.class);
private final Blockchain blockchain = mock(Blockchain.class);
private final BlockchainQueries blockchainQueries = mock(BlockchainQueries.class);
private final ChainHead chainHead = mock(ChainHead.class);
private final PendingTransactions pendingTransactions = mock(PendingTransactions.class);
private final EthGetTransactionCount ethGetTransactionCount =
new EthGetTransactionCount(blockchain, pendingTransactions);
new EthGetTransactionCount(blockchainQueries, pendingTransactions);
private final String pendingTransactionString = "0x00000000000000000000000000000000000000AA";
private final Object[] pendingParams = new Object[] {pendingTransactionString, "pending"};
@ -55,8 +60,10 @@ public class EthGetTransactionCountTest {
public void shouldUseLatestTransactionsWhenNoPendingTransactions() {
final Address address = Address.fromHexString(pendingTransactionString);
when(pendingTransactions.getNextNonceForSender(address)).thenReturn(OptionalLong.empty());
when(blockchain.headBlockNumber()).thenReturn(1L);
when(blockchain.getTransactionCount(address, 1L)).thenReturn(7L);
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.getBlockchain().getChainHead()).thenReturn(chainHead);
when(blockchainQueries.getBlockchain().getChainHead().getHash()).thenReturn(Hash.ZERO);
when(blockchainQueries.getTransactionCount(address, Hash.ZERO)).thenReturn(7L);
final JsonRpcRequestContext request =
new JsonRpcRequestContext(
new JsonRpcRequest("1", "eth_getTransactionCount", pendingParams));

@ -0,0 +1,21 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914"
},
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}

@ -0,0 +1,23 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914"
},
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}

@ -0,0 +1,24 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914"
},
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}

@ -0,0 +1,24 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914"
},
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}

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

@ -0,0 +1,23 @@
{
"request": {
"id": 3,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"data": "0x12a7b914"
},
{
"blockNumber": "0x19"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 3,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"statusCode": 200
}

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

@ -0,0 +1,17 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -0,0 +1,17 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
"0x19"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
{
"blockNumber": "0x19"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": "0x6cb0f6ed0e034ae5d"
},
"statusCode": 200
}

@ -11,7 +11,10 @@
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -11,7 +11,10 @@
"response": {
"jsonrpc": "2.0",
"id": 28,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -0,0 +1,20 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb1234"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,17 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -0,0 +1,17 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x19"
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
{
"blockNumber": "0x19"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"result": "0x6000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56"
},
"statusCode": 200
}

@ -11,7 +11,10 @@
"response": {
"jsonrpc": "2.0",
"id": 13,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -11,7 +11,10 @@
"response": {
"jsonrpc": "2.0",
"id": 13,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -0,0 +1,20 @@
{
"request": {
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb1234"
]
},
"response": {
"jsonrpc": "2.0",
"id": 0,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,30 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,32 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
{
"blockHash":"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
}
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,33 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
{
"blockHash":"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,33 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
{
"blockHash":"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,30 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"0x19"
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,32 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
{
"blockNumber":"0x19"
}
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a09e0124af825ca88d0c30ae4a69f2c339196c23952b0226f03c7e7460699c0541a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a044b83742345b4b2b4debce6d454e97bfb713ae1416dee357f5fd93f858a73a75808080a0d2c1b7d4a3c019943eff4e75716ade2750b1955abcf5d2355de6e3693d6c30d38080", "0xf872a0332fbb2bcac38ed596cbb34ae265df4d60b832ce8077a3abc6f57b4611005cfdb84ff84d808906cb0f6ed0e034ae5da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ],
"address" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"balance" : "0x6cb0f6ed0e034ae5d",
"codeHash" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce" : "0x0",
"storageHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ ]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,21 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"0x21"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,21 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"-0x10"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,21 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8888f1f195afa192cfee860698584c030f4c9db1",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb1234"
]
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,17 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": []
},
"response": {
"jsonrpc": "2.0",
"id": 28,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,30 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"latest"
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a084e747fd6c2e7ca25d6f219938c2d9e3014c9e86e3fc3fb0014dcef9d10b6815a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a07ac9345327d90f69293f207fd3dbad91418e38cf6c663c97e8cda89c32448509808080a093e09806aca0b1db534f5e6940b2d43a717c47bf4dfc342a104d9945e82a221d8080", "0xf86ba03b8ec137a2f5a74ec3a73144b552caad890b18b5f725872fa212fff6d4d565bab848f84680820140a0dd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515ba035178fc0de1e7fc754dbd07360e6f80bed818b9e51c62682f312442c4838ac47" ],
"address" : "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"balance" : "0x140",
"codeHash" : "0x35178fc0de1e7fc754dbd07360e6f80bed818b9e51c62682f312442c4838ac47",
"nonce" : "0x0",
"storageHash" : "0xdd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515b",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ "0xf8b18080a0c7f91ee5ea67d593275fcc773a02a5e5fb37b0625ca5c5cdc783483d43f2d7c280a06672614c102b0f02e747250bae452ed105110e25761c15a2a459afbd9eb8cf2e808080a0f671e05fab19f512b16fdcbc938f5fbbfbbc2fa67fecb575bb7721c221f71cf78080a0ba2fc36b0235d7ea299126bd4d404cb38456f32a6c236b422a3868f98c69eda1a0d77552655c7b63916586a73350b1933836f2378789613b548b90fa0a44125df180808080"]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,30 @@
{
"request": {
"id": 28,
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
["0x0000000000000000000000000000000000000000000000000000000000000347"],
"pending"
]
},
"response": {
"jsonrpc" : "2.0",
"id" : 28,
"result" : {
"accountProof" : [ "0xf891a084e747fd6c2e7ca25d6f219938c2d9e3014c9e86e3fc3fb0014dcef9d10b6815a097699db78357681938d946074cafa3355e921261ba0bd5081bff15c4f17d0c7f8080808080808080a07ac9345327d90f69293f207fd3dbad91418e38cf6c663c97e8cda89c32448509808080a093e09806aca0b1db534f5e6940b2d43a717c47bf4dfc342a104d9945e82a221d8080", "0xf86ba03b8ec137a2f5a74ec3a73144b552caad890b18b5f725872fa212fff6d4d565bab848f84680820140a0dd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515ba035178fc0de1e7fc754dbd07360e6f80bed818b9e51c62682f312442c4838ac47" ],
"address" : "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"balance" : "0x140",
"codeHash" : "0x35178fc0de1e7fc754dbd07360e6f80bed818b9e51c62682f312442c4838ac47",
"nonce" : "0x0",
"storageHash" : "0xdd3fa56425f8195f314c22547243081293b3f5537cd98ed8f84d4fda3f9a515b",
"storageProof" : [ {
"key" : "839",
"value" : "0x0",
"proof" : [ "0xf8b18080a0c7f91ee5ea67d593275fcc773a02a5e5fb37b0625ca5c5cdc783483d43f2d7c280a06672614c102b0f02e747250bae452ed105110e25761c15a2a459afbd9eb8cf2e808080a0f671e05fab19f512b16fdcbc938f5fbbfbbc2fa67fecb575bb7721c221f71cf78080a0ba2fc36b0235d7ea299126bd4d404cb38456f32a6c236b422a3868f98c69eda1a0d77552655c7b63916586a73350b1933836f2378789613b548b90fa0a44125df180808080"]
} ]
}
},
"statusCode": 200
}

@ -0,0 +1,18 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -0,0 +1,21 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -0,0 +1,21 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
{
"blockHash": "0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -0,0 +1,18 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
"0x19"
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
{
"blockNumber": "0x19"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"result": "0xaabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee"
},
"statusCode": 200
}

@ -12,7 +12,10 @@
"response": {
"jsonrpc": "2.0",
"id": 337,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -12,7 +12,10 @@
"response": {
"jsonrpc": "2.0",
"id": 337,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -0,0 +1,21 @@
{
"request": {
"id": 341,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"0x4",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb1234"
]
},
"response": {
"jsonrpc": "2.0",
"id": 341,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}

@ -0,0 +1,17 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0xf8f01382f5636d02edac7fff679a6feb7a572d37a395daaab77938feb6fe217f"
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": "0x0"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
{
"blockHash": "0xf8f01382f5636d02edac7fff679a6feb7a572d37a395daaab77938feb6fe217f"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": "0x0"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
{
"blockHash": "0xf8f01382f5636d02edac7fff679a6feb7a572d37a395daaab77938feb6fe217f",
"requireCanonical": true
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": "0x0"
},
"statusCode": 200
}

@ -0,0 +1,20 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
{
"blockHash": "0xf8f01382f5636d02edac7fff679a6feb7a572d37a395daaab77938feb6fe217f",
"requireCanonical": false
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": "0x0"
},
"statusCode": 200
}

@ -0,0 +1,19 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
{
"blockNumber": "0x0"
}
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": "0x0"
},
"statusCode": 200
}

@ -11,7 +11,10 @@
"response": {
"jsonrpc": "2.0",
"id": 487,
"result": null
"error": {
"code": -32602,
"message": "Invalid params"
}
},
"statusCode": 200
"statusCode": 400
}

@ -0,0 +1,20 @@
{
"request": {
"id": 487,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0xb73cee02246c6f32ac0f459934e89102c2ce904d966a4fc2ab6309c3e104b9cb1234"
]
},
"response": {
"jsonrpc": "2.0",
"id": 487,
"error" : {
"code" : -32602,
"message" : "Invalid params"
}
},
"statusCode": 400
}
Loading…
Cancel
Save