Skip to content

Commit

Permalink
chore: modify rest of the API calls to accept int for block num
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel committed Mar 16, 2023
1 parent 293a7a9 commit 2245bc8
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions libraries/core_libs/network/rpc/EthFace.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ class EthFace : public ServerInterface<EthFace> {
jsonrpc::Procedure("eth_blockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_blockNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBalance", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING,
"param1", JSON_ANY, "param2", jsonrpc::JSON_OBJECT, NULL),
"param1", jsonrpc::JSON_STRING, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getBalanceI);
this->bindAndAddMethod(
jsonrpc::Procedure("eth_getStorageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",
jsonrpc::JSON_STRING, "param2", JSON_ANY, "param3", jsonrpc::JSON_OBJECT, NULL),
jsonrpc::JSON_STRING, "param2", JSON_ANY, "param3", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getStorageAtI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getStorageRoot", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING,
"param1", jsonrpc::JSON_STRING, "param2", jsonrpc::JSON_STRING, NULL),
"param1", jsonrpc::JSON_STRING, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getStorageRootI);
this->bindAndAddMethod(
jsonrpc::Procedure("eth_getTransactionCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",
JSON_ANY, "param2", jsonrpc::JSON_OBJECT, NULL),
jsonrpc::JSON_STRING, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getTransactionCountI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByHash", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_getBlockTransactionCountByHashI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByNumber", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
jsonrpc::JSON_OBJECT, "param1", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getBlockTransactionCountByNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getUncleCountByBlockHash", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
Expand All @@ -53,16 +53,16 @@ class EthFace : public ServerInterface<EthFace> {
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_getUncleCountByBlockNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getCode", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING,
"param1", JSON_ANY, "param2", jsonrpc::JSON_OBJECT, NULL),
"param1", jsonrpc::JSON_STRING, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getCodeI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",
JSON_ANY, "param2", jsonrpc::JSON_OBJECT, NULL),
jsonrpc::JSON_OBJECT, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_callI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT,
"param1", jsonrpc::JSON_STRING, "param2", jsonrpc::JSON_BOOLEAN, NULL),
&taraxa::net::EthFace::eth_getBlockByHashI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT,
"param1", jsonrpc::JSON_STRING, "param2", jsonrpc::JSON_BOOLEAN, NULL),
"param1", JSON_ANY, "param2", jsonrpc::JSON_BOOLEAN, NULL),
&taraxa::net::EthFace::eth_getBlockByNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getTransactionByHash", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
Expand All @@ -71,10 +71,9 @@ class EthFace : public ServerInterface<EthFace> {
jsonrpc::Procedure("eth_getTransactionByBlockHashAndIndex", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT,
"param1", jsonrpc::JSON_STRING, "param2", jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_getTransactionByBlockHashAndIndexI);
this->bindAndAddMethod(
jsonrpc::Procedure("eth_getTransactionByBlockNumberAndIndex", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT,
"param1", jsonrpc::JSON_STRING, "param2", jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_getTransactionByBlockNumberAndIndexI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getTransactionByBlockNumberAndIndex", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", JSON_ANY, "param2", JSON_ANY, NULL),
&taraxa::net::EthFace::eth_getTransactionByBlockNumberAndIndexI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getTransactionReceipt", jsonrpc::PARAMS_BY_POSITION,
jsonrpc::JSON_OBJECT, "param1", jsonrpc::JSON_STRING, NULL),
&taraxa::net::EthFace::eth_getTransactionReceiptI);
Expand Down

0 comments on commit 2245bc8

Please sign in to comment.