rippled
Loading...
Searching...
No Matches
jtx_json.h
1#ifndef XRPL_TEST_JTX_JSON_H_INCLUDED
2#define XRPL_TEST_JTX_JSON_H_INCLUDED
3
4#include <test/jtx/Env.h>
5
6#include <xrpl/json/json_value.h>
7
8namespace ripple {
9namespace test {
10namespace jtx {
11
13class json
14{
15private:
17
18public:
19 explicit json(std::string const&);
20
21 explicit json(char const*);
22
23 explicit json(Json::Value);
24
25 template <class T>
26 json(Json::StaticString const& key, T const& value)
27 {
28 jv_[key] = value;
29 }
30
31 template <class T>
32 json(std::string const& key, T const& value)
33 {
34 jv_[key] = value;
35 }
36
37 void
38 operator()(Env&, JTx& jt) const;
39};
40
41} // namespace jtx
42} // namespace test
43} // namespace ripple
44
45#endif
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:102
Inject raw JSON.
Definition jtx_json.h:14
json(std::string const &key, T const &value)
Definition jtx_json.h:32
void operator()(Env &, JTx &jt) const
Definition jtx_json.cpp:26
json(Json::StaticString const &key, T const &value)
Definition jtx_json.h:26
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Execution context for applying a JSON transaction.
Definition JTx.h:26