xrpld
Loading...
Searching...
No Matches
fee.cpp
1#include <test/jtx/fee.h>
2
3#include <test/jtx/Env.h>
4#include <test/jtx/JTx.h>
5
6#include <xrpl/protocol/SField.h>
7
8#include <cassert>
9
10namespace xrpl::test::jtx {
11
12void
13Fee::operator()(Env& env, JTx& jt) const
14{
15 if (!manual_)
16 return;
17 jt.fillFee = false;
18 assert(!increment_ || !amount_);
19 if (increment_)
20 {
21 jt[sfFee] = STAmount(env.current()->fees().increment).getJson();
22 }
23 else if (amount_)
24 {
25 jt[sfFee] = amount_->getJson(JsonOptions::Values::None);
26 }
27}
28
29} // namespace xrpl::test::jtx
json::Value getJson(JsonOptions=JsonOptions::Values::None) const override
Definition STAmount.cpp:734
A transaction testing environment.
Definition Env.h:143
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition Env.h:353
void operator()(Env &, JTx &jt) const
Definition fee.cpp:13
std::optional< STAmount > amount_
Definition fee.h:19
Execution context for applying a JSON transaction.
Definition JTx.h:23