Skip to content

Commit

Permalink
Add defi-cli support for web3 RPCs and debug RPCs (#2606)
Browse files Browse the repository at this point in the history
* Add defi-cli support for web3 RPCs and debug RPCs

* Add dumpdb

* Add RPCs to test node
  • Loading branch information
sieniven authored Oct 23, 2023
1 parent d439c39 commit 96e950d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/defi-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, co

// Check if DVM or EVM RPC
int port = dvmport;
if (strMethod.rfind("eth_", 0) == 0 || strMethod.rfind("debug_", 0) == 0 || strMethod.rfind("net_", 0) == 0)
if (strMethod.rfind("eth_", 0) == 0 || strMethod.rfind("debug_", 0) == 0 || strMethod.rfind("net_", 0) == 0 || strMethod.rfind("web3_", 0) == 0)
port = evmport;

// Obtain event base
Expand Down
8 changes: 8 additions & 0 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "eth_getTransactionByBlockHashAndIndex", 1, "txIndex"},
{ "eth_getTransactionByBlockNumberAndIndex", 0, "tag"},
{ "eth_getTransactionByBlockNumberAndIndex", 1, "txIndex"},

{ "debug_traceTransaction", 0, "object"},
{ "debug_dumpdb", 0, "dump"},
{ "debug_dumpdb", 1, "from"},
{ "debug_dumpdb", 2, "limit"},
{ "debug_feeEstimate", 0, "tx"},

{ "web3_sha", 0, "input"},
};

/**
Expand Down
6 changes: 5 additions & 1 deletion test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,14 @@ def __init__(
# net
"net_version",
# debug
"debug_traceTransaction",
"debug_dumpdb",
"debug_logaccountstates",
"debug_logblocktemplates",
"debug_feeEstimate",
"debug_logqueues",
# web3
"web3_clientVersion",
"web3_sha3",
}

def get_genesis_keys(self):
Expand Down

0 comments on commit 96e950d

Please sign in to comment.