rippled
Loading...
Searching...
No Matches
jtx_json.h
1#pragma once
2
3#include <test/jtx/Env.h>
4
5#include <xrpl/json/json_value.h>
6
7namespace xrpl {
8namespace test {
9namespace jtx {
10
12class json
13{
14private:
16
17public:
18 explicit json(std::string const&);
19
20 explicit json(char const*);
21
22 explicit json(Json::Value);
23
24 template <class T>
25 json(Json::StaticString const& key, T const& value)
26 {
27 jv_[key] = value;
28 }
29
30 template <class T>
31 json(std::string const& key, T const& value)
32 {
33 jv_[key] = value;
34 }
35
36 void
37 operator()(Env&, JTx& jt) const;
38};
39
40} // namespace jtx
41} // namespace test
42} // namespace xrpl
Lightweight wrapper to tag static string.
Definition json_value.h:44
Represents a JSON value.
Definition json_value.h:130
A transaction testing environment.
Definition Env.h:119
Inject raw JSON.
Definition jtx_json.h:13
void operator()(Env &, JTx &jt) const
Definition jtx_json.cpp:26
json(Json::StaticString const &key, T const &value)
Definition jtx_json.h:25
Json::Value jv_
Definition jtx_json.h:15
json(std::string const &key, T const &value)
Definition jtx_json.h:31
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Execution context for applying a JSON transaction.
Definition JTx.h:25