20 #include <ripple/beast/unit_test.h>
21 #include <ripple/protocol/Feature.h>
33 testcase(
"Convert all of an asset using DeliverMin");
36 auto const gw =
Account(
"gateway");
37 auto const USD = gw[
"USD"];
40 Env env(*
this, features);
41 env.
fund(
XRP(10000),
"alice",
"bob",
"carol", gw);
42 env.
trust(USD(100),
"alice",
"bob",
"carol");
43 env(
pay(
"alice",
"bob", USD(10)),
46 env(
pay(
"alice",
"bob", USD(10)),
50 env(
pay(
"alice",
"bob", USD(10)),
54 env(
pay(
"alice",
"bob", USD(10)),
58 env(
pay(
"alice",
"bob", USD(10)),
62 env(
pay(gw,
"carol", USD(50)));
63 env(offer(
"carol",
XRP(5), USD(5)));
64 env(
pay(
"alice",
"bob", USD(10)),
75 Env env(*
this, features);
76 env.
fund(
XRP(10000),
"alice",
"bob", gw);
77 env.
trust(USD(1000),
"alice",
"bob");
78 env(
pay(gw,
"bob", USD(100)));
79 env(offer(
"bob",
XRP(100), USD(100)));
80 env(
pay(
"alice",
"alice", USD(10000)),
89 Env env(*
this, features);
90 env.
fund(
XRP(10000),
"alice",
"bob",
"carol", gw);
91 env.
trust(USD(1000),
"bob",
"carol");
92 env(
pay(gw,
"bob", USD(200)));
93 env(offer(
"bob",
XRP(100), USD(100)));
94 env(offer(
"bob",
XRP(1000), USD(100)));
95 env(offer(
"bob",
XRP(10000), USD(100)));
96 env(
pay(
"alice",
"carol", USD(10000)),
102 env(
pay(
"alice",
"carol", USD(10000)),
112 Env env(*
this, features);
113 env.
fund(
XRP(10000),
"alice",
"bob",
"carol",
"dan", gw);
114 env.
trust(USD(1000),
"bob",
"carol",
"dan");
115 env(
pay(gw,
"bob", USD(100)));
116 env(
pay(gw,
"dan", USD(100)));
117 env(offer(
"bob",
XRP(100), USD(100)));
118 env(offer(
"bob",
XRP(1000), USD(100)));
119 env(offer(
"dan",
XRP(100), USD(100)));
120 env(
pay(
"alice",
"carol", USD(10000)),
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 require(Args const &... args)
Check a set of requirements.
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
void test_convert_all_of_an_asset(FeatureBitset features)
constexpr std::uint32_t tfPartialPayment
Sets the SendMax on a JTx.
Set Paths, SendMax on a JTx.
FeatureBitset supported_amendments()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value pay(Account const &account, Account const &to, AnyAmount amount)
Create a payment.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Sets the DeliverMin on a JTx.
Immutable cryptographic account descriptor.
const uint256 featureFlowCross
A transaction testing environment.
BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple)