18 #include <ripple/beast/unit_test.h>
19 #include <ripple/core/ConfigSections.h>
20 #include <ripple/protocol/jss.h>
22 #include <test/jtx/JSONRPCClient.h>
23 #include <test/jtx/WSClient.h>
34 testcase <<
"Overload " << (useWS ?
"WS" :
"HTTP") <<
" RPC client";
37 cfg->loadFromString(
"[" SECTION_SIGNING_SUPPORT
"]\ntrue");
43 env.fund(
XRP(10000), alice, bob);
50 tx[jss::tx_json] =
pay(alice, bob,
XRP(1));
56 bool warned =
false, booted =
false;
57 for (
int i = 0; i < 500 && !booted; ++i)
59 auto jv = client->invoke(
"sign", tx);
65 else if (!(jv.isMember(jss::status) &&
66 (jv[jss::status] ==
"success")))
71 fail(
"", __FILE__, __LINE__);
74 if (jv.isMember(jss::warning))
75 warned = jv[jss::warning] == jss::load;
77 BEAST_EXPECT(warned && booted);
const XRP_t XRP
Converts to XRP Issue or STAmount.
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
std::unique_ptr< AbstractClient > makeJSONRPCClient(Config const &cfg, unsigned rpc_version)
Returns a client using JSON-RPC over HTTP/S.
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
std::unique_ptr< Config > no_admin(std::unique_ptr< Config >)
adjust config so no admin ports are enabled
@ objectValue
object value (collection of name/value pairs).
void testOverload(bool useWS)
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value pay(Account const &account, Account const &to, AnyAmount amount)
Create a payment.
std::unique_ptr< WSClient > makeWSClient(Config const &cfg, bool v2, unsigned rpc_version, std::unordered_map< std::string, std::string > const &headers)
Returns a client operating through WebSockets/S.
Immutable cryptographic account descriptor.
A transaction testing environment.
BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple)