rippled
Loading...
Searching...
No Matches
prop.h
1#ifndef XRPL_TEST_JTX_PROP_H_INCLUDED
2#define XRPL_TEST_JTX_PROP_H_INCLUDED
3
4#include <test/jtx/Env.h>
5
6#include <memory>
7
8namespace ripple {
9namespace test {
10namespace jtx {
11
13template <class Prop>
14struct prop
15{
17
18 template <class... Args>
19 prop(Args&&... args)
20 : p_(std::make_unique<prop_type<Prop>>(std::forward<Args>(args)...))
21 {
22 }
23
24 void
25 operator()(Env& env, JTx& jt) const
26 {
27 jt.set(p_->clone());
28 }
29};
30
31} // namespace jtx
32} // namespace test
33} // namespace ripple
34
35#endif
A transaction testing environment.
Definition Env.h:102
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
STL namespace.
Execution context for applying a JSON transaction.
Definition JTx.h:26
void set(std::unique_ptr< basic_prop > p)
Set a property If the property already exists, it is replaced.
Definition JTx.h:103
Set a property on a JTx.
Definition prop.h:15
std::unique_ptr< basic_prop > p_
Definition prop.h:16
prop(Args &&... args)
Definition prop.h:19
void operator()(Env &env, JTx &jt) const
Definition prop.h:25