xrpld
Loading...
Searching...
No Matches
jtx_json.h
1#pragma once
2
3#include <test/jtx/Env.h>
4#include <test/jtx/JTx.h>
5
6#include <xrpl/json/json_value.h>
7
8#include <string>
9
10namespace xrpl::test::jtx {
11
15class Json
16{
17private:
19
20public:
21 explicit Json(std::string const&);
22
23 explicit Json(char const*);
24
26
27 template <class T>
28 Json(::json::StaticString const& key, T const& value)
29 {
30 jv_[key] = value;
31 }
32
33 template <class T>
34 Json(std::string const& key, T const& value)
35 {
36 jv_[key] = value;
37 }
38
39 void
40 operator()(Env&, JTx& jt) const;
41};
42
43} // namespace xrpl::test::jtx
Lightweight wrapper to tag static string.
Definition json_value.h:48
Represents a JSON value.
Definition json_value.h:117
A transaction testing environment.
Definition Env.h:161
Json(std::string const &key, T const &value)
Definition jtx_json.h:34
Json(::json::StaticString const &key, T const &value)
Definition jtx_json.h:28
::json::Value jv_
Definition jtx_json.h:18
void operator()(Env &, JTx &jt) const
Definition jtx_json.cpp:31
Json(std::string const &)
Definition jtx_json.cpp:16
Json(::json::Value)
Execution context for applying a JSON transaction.
Definition JTx.h:27