rippled
Loading...
Searching...
No Matches
utility.h
1#ifndef XRPL_TEST_JTX_UTILITY_H_INCLUDED
2#define XRPL_TEST_JTX_UTILITY_H_INCLUDED
3
4#include <test/jtx/Account.h>
5
6#include <xrpld/app/ledger/Ledger.h>
7
8#include <xrpl/json/json_value.h>
9#include <xrpl/protocol/STObject.h>
10
11#include <stdexcept>
12
13namespace ripple {
14namespace test {
15namespace jtx {
16
19{
20 template <class String>
21 explicit parse_error(String const& s) : logic_error(s)
22 {
23 }
24};
25
32parse(Json::Value const& jv);
33
37void
38sign(Json::Value& jv, Account const& account, Json::Value& sigObject);
39
43void
44sign(Json::Value& jv, Account const& account);
45
47void
48fill_fee(Json::Value& jv, ReadView const& view);
49
51void
52fill_seq(Json::Value& jv, ReadView const& view);
53
57 std::vector<std::string> const& args,
59 unsigned int apiVersion);
60
61} // namespace jtx
62} // namespace test
63} // namespace ripple
64
65#endif
Represents a JSON value.
Definition json_value.h:130
A generic endpoint for log messages.
Definition Journal.h:41
A view into a ledger.
Definition ReadView.h:32
Immutable cryptographic account descriptor.
Definition Account.h:20
void fill_seq(Json::Value &jv, ReadView const &view)
Set the sequence number automatically.
Definition utility.cpp:53
void sign(Json::Value &jv, Account const &account, Json::Value &sigObject)
Sign automatically into a specific Json field of the jv object.
Definition utility.cpp:28
Json::Value cmdToJSONRPC(std::vector< std::string > const &args, beast::Journal j, unsigned int apiVersion)
Given a rippled unit test rpc command, return the corresponding JSON.
Definition utility.cpp:67
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition utility.cpp:19
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition utility.cpp:45
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Thrown when parse fails.
Definition utility.h:19
parse_error(String const &s)
Definition utility.h:21