xrpld
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::test::jtx {
8
10class Json
11{
12private:
14
15public:
16 explicit Json(std::string const&);
17
18 explicit Json(char const*);
19
21
22 template <class T>
23 Json(::json::StaticString const& key, T const& value)
24 {
25 jv_[key] = value;
26 }
27
28 template <class T>
29 Json(std::string const& key, T const& value)
30 {
31 jv_[key] = value;
32 }
33
34 void
35 operator()(Env&, JTx& jt) const;
36};
37
38} // namespace xrpl::test::jtx
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:143
Json(std::string const &key, T const &value)
Definition jtx_json.h:29
Json(::json::StaticString const &key, T const &value)
Definition jtx_json.h:23
::json::Value jv_
Definition jtx_json.h:13
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:23