20 #include <ripple/beast/unit_test.h>
37 env(offer(
"alice",
XRP(i), iou(1)));
46 auto const billion = 1000000000ul;
49 auto const gw =
Account(
"gateway");
50 auto const USD = gw[
"USD"];
51 env.
fund(
XRP(billion), gw,
"alice");
52 env.
trust(USD(billion),
"alice");
53 env(
pay(gw,
"alice", USD(billion)));
92 env(offer(
"alice",
XRP(1), iou(1)));
102 auto const billion = 1000000000ul;
105 auto const gw =
Account(
"gateway");
106 auto const USD = gw[
"USD"];
107 env.
fund(
XRP(billion), gw,
"alice");
108 env.
trust(USD(billion),
"alice");
109 env(
pay(gw,
"alice", USD(billion)));
111 env(
pay(
"alice", gw, USD(billion)));
112 env(offer(
"alice", USD(1),
XRP(1)));
130 template <
class Function>
156 env(offer(
"alice",
XRP(i), iou(1)));
165 auto const billion = 1000000000ul;
168 auto const gw =
Account(
"gateway");
169 auto const USD = gw[
"USD"];
170 env.
fund(
XRP(billion), gw,
"alice");
171 env.
trust(USD(billion),
"alice");
172 env(
pay(gw,
"alice", USD(billion)));
174 env(
pay(
"alice", gw, USD(billion)));
175 env(offer(
"alice", USD(1),
XRP(1)),
ter(std::ignore));
183 bfind(100, 9000, [&](
std::size_t n) {
return oversize(n); });
184 log <<
"Min oversize offers = " << result <<
'\n';
const XRP_t XRP
Converts to XRP Issue or STAmount.
Set the expected result code for a JTx The test will fail if the code doesn't match.
void disable_sigs()
Turn off signature checks.
bool oversize(std::size_t n)
TER ter() const
Return the TER for the last JTx.
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
static std::size_t bfind(std::size_t lo, std::size_t hi, Function &&f)
BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, tx, ripple, 10)
void createOffers(jtx::Env &env, jtx::IOU const &iou, std::size_t n)
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Converts to IOU Issue or STAmount.
Json::Value pay(Account const &account, Account const &to, AnyAmount amount)
Create a payment.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Immutable cryptographic account descriptor.
void createOffers(jtx::Env &env, jtx::IOU const &iou, std::size_t n)
A transaction testing environment.
BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple)