rippled
Loading...
Searching...
No Matches
fee.cpp
1#include <test/jtx/fee.h>
2
3#include <xrpl/protocol/jss.h>
4
5namespace xrpl {
6namespace test {
7namespace jtx {
8
9void
10fee::operator()(Env& env, JTx& jt) const
11{
12 if (!manual_)
13 return;
14 jt.fill_fee = false;
15 assert(!increment_ || !amount_);
16 if (increment_)
17 {
18 jt[sfFee] = STAmount(env.current()->fees().increment).getJson();
19 }
20 else if (amount_)
21 {
22 jt[sfFee] = amount_->getJson(JsonOptions::none);
23 }
24}
25
26} // namespace jtx
27} // namespace test
28} // namespace xrpl
Json::Value getJson(JsonOptions=JsonOptions::none) const override
Definition STAmount.cpp:744
A transaction testing environment.
Definition Env.h:122
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition Env.h:329
std::optional< STAmount > amount_
Definition fee.h:21
void operator()(Env &, JTx &jt) const
Definition fee.cpp:10
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Execution context for applying a JSON transaction.
Definition JTx.h:25