rippled
Loading...
Searching...
No Matches
utility.h
1#pragma once
2
3#include <test/jtx/Account.h>
4
5#include <xrpld/app/ledger/Ledger.h>
6
7#include <xrpl/json/json_value.h>
8#include <xrpl/protocol/STObject.h>
9
10#include <stdexcept>
11
12namespace xrpl {
13namespace test {
14namespace jtx {
15
18{
19 template <class String>
20 explicit parse_error(String const& s) : logic_error(s)
21 {
22 }
23};
24
31parse(Json::Value const& jv);
32
36void
37sign(Json::Value& jv, Account const& account, Json::Value& sigObject);
38
42void
43sign(Json::Value& jv, Account const& account);
44
46void
47fill_fee(Json::Value& jv, ReadView const& view);
48
50void
51fill_seq(Json::Value& jv, ReadView const& view);
52
55cmdToJSONRPC(std::vector<std::string> const& args, beast::Journal j, unsigned int apiVersion);
56
57} // namespace jtx
58} // namespace test
59} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
A generic endpoint for log messages.
Definition Journal.h:40
A view into a ledger.
Definition ReadView.h:31
Immutable cryptographic account descriptor.
Definition Account.h:19
void fill_seq(Json::Value &jv, ReadView const &view)
Set the sequence number automatically.
Definition utility.cpp:52
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:66
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:27
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Definition utility.cpp:18
void fill_fee(Json::Value &jv, ReadView const &view)
Set the fee automatically.
Definition utility.cpp:44
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Thrown when parse fails.
Definition utility.h:18
parse_error(String const &s)
Definition utility.h:20