1#include <test/jtx/balance.h>
3#include <test/jtx/Env.h>
5#include <xrpl/protocol/AccountID.h>
6#include <xrpl/protocol/Indexes.h>
7#include <xrpl/protocol/Issue.h>
8#include <xrpl/protocol/MPTIssue.h>
9#include <xrpl/protocol/SField.h>
10#include <xrpl/protocol/STAmount.h>
16#define TEST_EXPECT(cond) env.test.expect(cond, __FILE__, __LINE__)
17#define TEST_EXPECTS(cond, reason) \
18 ((cond) ? (env.test.pass(), true) : (env.test.fail((reason), __FILE__, __LINE__), false))
30 else if (TEST_EXPECT(sle))
33 sle->getFieldAmount(sfBalance) == value,
34 sle->getFieldAmount(sfBalance).getText() +
" / " + value.getText());
44 else if (TEST_EXPECT(sle))
46 auto amount = sle->getFieldAmount(sfBalance);
47 amount.get<
Issue>().account = value.getIssuer();
48 if (account > value.getIssuer())
50 TEST_EXPECTS(amount == value, amount.getText());
68 else if (TEST_EXPECT(sle))
70 STAmount const amount{mptIssue, sle->getFieldU64(sfMPTAmount)};
71 TEST_EXPECT(amount == value);
A currency issued by an account.
constexpr MPTID const & getMptID() const
void operator()(Env &) const
A transaction testing environment.
SLE::const_pointer le(Account const &account) const
Return an account root.
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet trustLine(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
void doBalance(Env &env, AccountID const &account, bool kNone, STAmount const &value, Issue const &issue)
bool isXRP(AccountID const &c)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.