xrpld
Loading...
Searching...
No Matches
prop.h
1#pragma once
2
3#include <test/jtx/Env.h>
4#include <test/jtx/JTx.h>
5#include <test/jtx/basic_prop.h>
6
7#include <memory>
8
9namespace xrpl::test::jtx {
10
14template <class T>
15struct Prop
16{
18
19 template <class... Args>
20 Prop(Args&&... args) : p(std::make_unique<PropType<T>>(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 xrpl::test::jtx
A transaction testing environment.
Definition Env.h:161
STL namespace.
Execution context for applying a JSON transaction.
Definition JTx.h:27
void set(std::unique_ptr< BasicProp > p)
Set a property If the property already exists, it is replaced.
Definition JTx.h:105
void operator()(Env &env, JTx &jt) const
Definition prop.h:25
Prop(Args &&... args)
Definition prop.h:20
std::unique_ptr< BasicProp > p
Definition prop.h:17