rippled
Loading...
Searching...
No Matches
utility.h
1#pragma once
2
3#include <test/jtx/Account.h>
4
5#include <xrpl/json/json_value.h>
6#include <xrpl/ledger/Ledger.h>
7#include <xrpl/protocol/STObject.h>
8
9#include <stdexcept>
10
11namespace xrpl {
12namespace test {
13namespace jtx {
14
17{
18 template <class String>
19 explicit parse_error(String const& s) : logic_error(s)
20 {
21 }
22};
23
30parse(Json::Value const& jv);
31
35void
36sign(Json::Value& jv, Account const& account, Json::Value& sigObject);
37
41void
42sign(Json::Value& jv, Account const& account);
43
45void
46fill_fee(Json::Value& jv, ReadView const& view);
47
49void
50fill_seq(Json::Value& jv, ReadView const& view);
51
54cmdToJSONRPC(std::vector<std::string> const& args, beast::Journal j, unsigned int apiVersion);
55
56} // namespace jtx
57} // namespace test
58} // 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:17
parse_error(String const &s)
Definition utility.h:19