3#include <xrpl/beast/unit_test.h>
27 auto const billion = 1000000000ul;
30 auto const gw =
Account(
"gateway");
31 auto const USD = gw[
"USD"];
32 env.
fund(
XRP(billion), gw,
"alice");
33 env.
trust(USD(billion),
"alice");
34 env(
pay(gw,
"alice", USD(billion)));
45BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(PlumpBook, app,
ripple, 5);
60BEAST_DEFINE_TESTSUITE(ThinBook, app,
ripple);
83 auto const billion = 1000000000ul;
86 auto const gw =
Account(
"gateway");
87 auto const USD = gw[
"USD"];
88 env.
fund(
XRP(billion), gw,
"alice");
89 env.
trust(USD(billion),
"alice");
90 env(
pay(gw,
"alice", USD(billion)));
92 env(
pay(
"alice", gw, USD(billion)));
103BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(OversizeMeta, app,
ripple, 3);
111 template <
class Function>
137 env(
offer(
"alice",
XRP(i), iou(1)));
146 auto const billion = 1000000000ul;
149 auto const gw =
Account(
"gateway");
150 auto const USD = gw[
"USD"];
151 env.
fund(
XRP(billion), gw,
"alice");
152 env.
trust(USD(billion),
"alice");
153 env(
pay(gw,
"alice", USD(billion)));
155 env(
pay(
"alice", gw, USD(billion)));
156 env(
offer(
"alice", USD(1),
XRP(1)),
ter(std::ignore));
165 log <<
"Min oversize offers = " << result <<
'\n';
169BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(FindOversizeCross, app,
ripple, 50);
log_os< char > log
Logging output stream.
static std::size_t bfind(std::size_t lo, std::size_t hi, Function &&f)
void createOffers(jtx::Env &env, jtx::IOU const &iou, std::size_t n)
void run() override
Runs the suite.
bool oversize(std::size_t n)
void run() override
Runs the suite.
void createOffers(jtx::Env &env, jtx::IOU const &iou, std::size_t n)
void run() override
Runs the suite.
Immutable cryptographic account descriptor.
A transaction testing environment.
TER ter() const
Return the TER for the last JTx.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
void disable_sigs()
Turn off signature checks.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Converts to IOU Issue or STAmount.
Set the expected result code for a JTx The test will fail if the code doesn't match.
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.