xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
fee.h
1
#pragma once
2
3
#include <test/jtx/Env.h>
4
#include <test/jtx/JTx.h>
5
#include <test/jtx/tags.h>
6
7
#include <xrpl/basics/contract.h>
8
#include <xrpl/protocol/STAmount.h>
9
10
#include <
cstdint
>
11
#include <
optional
>
12
#include <
stdexcept
>
13
14
namespace
xrpl::test::jtx
{
15
19
class
Fee
20
{
21
private
:
22
bool
manual_
=
true
;
23
bool
increment_
=
false
;
24
std::optional<STAmount>
amount_
;
25
26
public
:
27
explicit
Fee
(
AutofillT
) :
manual_
(false)
28
{
29
}
30
31
explicit
Fee
(
IncrementT
) :
increment_
(true)
32
{
33
}
34
35
explicit
Fee
(
NoneT
)
36
{
37
}
38
39
explicit
Fee
(
STAmount
const
& amount) :
amount_
(amount)
40
{
41
if
(!
isXRP
(*
amount_
))
42
Throw<std::runtime_error>
(
"fee: not XRP"
);
43
}
44
45
explicit
Fee
(
std::uint64_t
amount,
bool
negative =
false
) :
Fee
{
STAmount
{amount, negative}}
46
{
47
}
48
49
void
50
operator()
(
Env
&,
JTx
& jt)
const
;
51
};
52
53
}
// namespace xrpl::test::jtx
xrpl::STAmount
Definition
STAmount.h:46
xrpl::test::jtx::Env
A transaction testing environment.
Definition
Env.h:161
xrpl::test::jtx::Fee::Fee
Fee(IncrementT)
Definition
fee.h:31
xrpl::test::jtx::Fee::manual_
bool manual_
Definition
fee.h:22
xrpl::test::jtx::Fee::operator()
void operator()(Env &, JTx &jt) const
Definition
fee.cpp:13
xrpl::test::jtx::Fee::Fee
Fee(std::uint64_t amount, bool negative=false)
Definition
fee.h:45
xrpl::test::jtx::Fee::increment_
bool increment_
Definition
fee.h:23
xrpl::test::jtx::Fee::Fee
Fee(NoneT)
Definition
fee.h:35
xrpl::test::jtx::Fee::Fee
Fee(AutofillT)
Definition
fee.h:27
xrpl::test::jtx::Fee::amount_
std::optional< STAmount > amount_
Definition
fee.h:24
xrpl::test::jtx::Fee::Fee
Fee(STAmount const &amount)
Definition
fee.h:39
cstdint
std::uint64_t
xrpl::test::jtx
Definition
Oracle_test.cpp:34
xrpl::isXRP
bool isXRP(AccountID const &c)
Definition
AccountID.h:84
xrpl::Throw
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Definition
contract.h:52
optional
stdexcept
xrpl::test::jtx::AutofillT
Definition
tags.h:12
xrpl::test::jtx::IncrementT
Used for Fee() calls that use an owner reserve increment.
Definition
tags.h:27
xrpl::test::jtx::JTx
Execution context for applying a JSON transaction.
Definition
JTx.h:27
xrpl::test::jtx::NoneT
Definition
tags.h:6
Generated by
1.17.0