Make Clio RPCs more consistent with rippled (#110)

* parse ledger_index as number

* allow websocket to use "command" or "method"

* mark all non-forwarded responses as validated

* dont mark forwarded errors as successful

* reduce forwarding Websocket expiration 30->3 seconds

* fix merge conflict in test.py

* adds ledger_current and ledger_closed

* deserialize `taker_gets_funded` into amount json

* limit account RPCs by number of objects traversed

* assign result correctly
This commit is contained in:
Nathan Nichols
2022-03-21 18:28:03 -05:00
committed by GitHub
parent 945222840b
commit 1d5c482d9c
17 changed files with 394 additions and 113 deletions

View File

@@ -1,4 +1,5 @@
#include <rpc/Counters.h>
#include <rpc/RPC.h>
namespace RPC {
@@ -19,6 +20,9 @@ Counters::initializeCounter(std::string const& method)
void
Counters::rpcErrored(std::string const& method)
{
if (!validHandler(method))
return;
initializeCounter(method);
std::shared_lock lk(mutex_);
@@ -32,6 +36,9 @@ Counters::rpcComplete(
std::string const& method,
std::chrono::microseconds const& rpcDuration)
{
if (!validHandler(method))
return;
initializeCounter(method);
std::shared_lock lk(mutex_);
@@ -44,6 +51,9 @@ Counters::rpcComplete(
void
Counters::rpcForwarded(std::string const& method)
{
if (!validHandler(method))
return;
initializeCounter(method);
std::shared_lock lk(mutex_);