mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 15:20:54 +00:00
32 lines
508 B
C++
32 lines
508 B
C++
#pragma once
|
|
|
|
#include <test/jtx/Env.h>
|
|
#include <test/jtx/JTx.h>
|
|
#include <test/jtx/basic_prop.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace xrpl::test::jtx {
|
|
|
|
/**
|
|
* Set a property on a JTx.
|
|
*/
|
|
template <class T>
|
|
struct Prop
|
|
{
|
|
std::unique_ptr<BasicProp> p;
|
|
|
|
template <class... Args>
|
|
Prop(Args&&... args) : p(std::make_unique<PropType<T>>(std::forward<Args>(args)...))
|
|
{
|
|
}
|
|
|
|
void
|
|
operator()(Env& env, JTx& jt) const
|
|
{
|
|
jt.set(p->clone());
|
|
}
|
|
};
|
|
|
|
} // namespace xrpl::test::jtx
|