rippled
Loading...
Searching...
No Matches
WSClient_test.cpp
1#include <test/jtx.h>
2#include <test/jtx/WSClient.h>
3
4#include <xrpl/beast/unit_test.h>
5
6namespace ripple {
7namespace test {
8
10{
11public:
12 void
13 run() override
14 {
15 using namespace jtx;
16 Env env(*this);
17 auto wsc = makeWSClient(env.app().config());
18 {
19 Json::Value jv;
20 jv["streams"] = Json::arrayValue;
21 jv["streams"].append("ledger");
22 }
23 env.fund(XRP(10000), "alice");
24 env.close();
25 auto jv = wsc->getMsg(std::chrono::seconds(1));
26 pass();
27 }
28};
29
30BEAST_DEFINE_TESTSUITE(WSClient, jtx, ripple);
31
32} // namespace test
33} // namespace ripple
Represents a JSON value.
Definition json_value.h:130
Value & append(Value const &value)
Append value to array at the end.
A testsuite class.
Definition suite.h:52
void pass()
Record a successful test condition.
Definition suite.h:508
virtual Config & config()=0
void run() override
Runs the suite.
A transaction testing environment.
Definition Env.h:102
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition Env.cpp:103
Application & app()
Definition Env.h:242
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition Env.cpp:271
@ arrayValue
array value (ordered list)
Definition json_value.h:25
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
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.
Definition WSClient.cpp:304
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6