rippled
CrossingLimits_test.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5  Permission to use, copy, modify, and/or distribute this software for any
6  purpose with or without fee is hereby granted, provided that the above
7  copyright notice and this permission notice appear in all copies.
8  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16 //==============================================================================
17 
18 #include <ripple/beast/unit_test.h>
19 #include <ripple/protocol/Feature.h>
20 #include <test/jtx.h>
21 
22 namespace ripple {
23 namespace test {
24 
25 class CrossingLimits_test : public beast::unit_test::suite
26 {
27 private:
28  void
30  jtx::Env& env,
31  std::size_t n,
32  jtx::Account const& account,
33  STAmount const& in,
34  STAmount const& out)
35  {
36  using namespace jtx;
37  auto const ownerCount = env.le(account)->getFieldU32(sfOwnerCount);
38  for (std::size_t i = 0; i < n; i++)
39  {
40  env(offer(account, in, out));
41  env.close();
42  }
43  env.require(owners(account, ownerCount + n));
44  }
45 
46 public:
47  void
49  {
50  testcase("Step Limit");
51 
52  using namespace jtx;
53  Env env(*this, features);
54 
55  auto const gw = Account("gateway");
56  auto const USD = gw["USD"];
57 
58  env.fund(XRP(100000000), gw, "alice", "bob", "carol", "dan");
59  env.trust(USD(1), "bob");
60  env(pay(gw, "bob", USD(1)));
61  env.trust(USD(1), "dan");
62  env(pay(gw, "dan", USD(1)));
63  n_offers(env, 2000, "bob", XRP(1), USD(1));
64  n_offers(env, 1, "dan", XRP(1), USD(1));
65 
66  // Alice offers to buy 1000 XRP for 1000 USD. She takes Bob's first
67  // offer, removes 999 more as unfunded, then hits the step limit.
68  env(offer("alice", USD(1000), XRP(1000)));
69  env.require(balance("alice", USD(1)));
70  env.require(owners("alice", 2));
71  env.require(balance("bob", USD(0)));
72  env.require(owners("bob", 1001));
73  env.require(balance("dan", USD(1)));
74  env.require(owners("dan", 2));
75 
76  // Carol offers to buy 1000 XRP for 1000 USD. She removes Bob's next
77  // 1000 offers as unfunded and hits the step limit.
78  env(offer("carol", USD(1000), XRP(1000)));
79  env.require(balance("carol", USD(none)));
80  env.require(owners("carol", 1));
81  env.require(balance("bob", USD(0)));
82  env.require(owners("bob", 1));
83  env.require(balance("dan", USD(1)));
84  env.require(owners("dan", 2));
85  }
86 
87  void
89  {
90  testcase("Crossing Limit");
91 
92  using namespace jtx;
93  Env env(*this, features);
94 
95  auto const gw = Account("gateway");
96  auto const USD = gw["USD"];
97 
98  // The number of allowed offers to cross is different between
99  // Taker and FlowCross. Taker allows 850 and FlowCross allows 1000.
100  // Accommodate that difference in the test.
101  int const maxConsumed = features[featureFlowCross] ? 1000 : 850;
102 
103  env.fund(XRP(100000000), gw, "alice", "bob", "carol");
104  int const bobsOfferCount = maxConsumed + 150;
105  env.trust(USD(bobsOfferCount), "bob");
106  env(pay(gw, "bob", USD(bobsOfferCount)));
107  env.close();
108  n_offers(env, bobsOfferCount, "bob", XRP(1), USD(1));
109 
110  // Alice offers to buy Bob's offers. However she hits the offer
111  // crossing limit, so she can't buy them all at once.
112  env(offer("alice", USD(bobsOfferCount), XRP(bobsOfferCount)));
113  env.close();
114  env.require(balance("alice", USD(maxConsumed)));
115  env.require(balance("bob", USD(150)));
116  env.require(owners("bob", 150 + 1));
117 
118  // Carol offers to buy 1000 XRP for 1000 USD. She takes Bob's
119  // remaining 150 offers without hitting a limit.
120  env(offer("carol", USD(1000), XRP(1000)));
121  env.close();
122  env.require(balance("carol", USD(150)));
123  env.require(balance("bob", USD(0)));
124  env.require(owners("bob", 1));
125  }
126 
127  void
129  {
130  testcase("Step And Crossing Limit");
131 
132  using namespace jtx;
133  Env env(*this, features);
134 
135  auto const gw = Account("gateway");
136  auto const USD = gw["USD"];
137 
138  env.fund(XRP(100000000), gw, "alice", "bob", "carol", "dan", "evita");
139 
140  // The number of offers allowed to cross is different between
141  // Taker and FlowCross. Taker allows 850 and FlowCross allows 1000.
142  // Accommodate that difference in the test.
143  bool const isFlowCross{features[featureFlowCross]};
144  int const maxConsumed = isFlowCross ? 1000 : 850;
145 
146  int const evitasOfferCount{maxConsumed + 49};
147  env.trust(USD(1000), "alice");
148  env(pay(gw, "alice", USD(1000)));
149  env.trust(USD(1000), "carol");
150  env(pay(gw, "carol", USD(1)));
151  env.trust(USD(evitasOfferCount + 1), "evita");
152  env(pay(gw, "evita", USD(evitasOfferCount + 1)));
153 
154  // Taker and FlowCross have another difference we must accommodate.
155  // Taker allows a total of 1000 unfunded offers to be consumed
156  // beyond the 850 offers it can take. FlowCross draws no such
157  // distinction; its limit is 1000 funded or unfunded.
158  //
159  // Give carol an extra 150 (unfunded) offers when we're using Taker
160  // to accommodate that difference.
161  int const carolsOfferCount{isFlowCross ? 700 : 850};
162  n_offers(env, 400, "alice", XRP(1), USD(1));
163  n_offers(env, carolsOfferCount, "carol", XRP(1), USD(1));
164  n_offers(env, evitasOfferCount, "evita", XRP(1), USD(1));
165 
166  // Bob offers to buy 1000 XRP for 1000 USD. He takes all 400 USD from
167  // Alice's offers, 1 USD from Carol's and then removes 599 of Carol's
168  // offers as unfunded, before hitting the step limit.
169  env(offer("bob", USD(1000), XRP(1000)));
170  env.require(balance("bob", USD(401)));
171  env.require(balance("alice", USD(600)));
172  env.require(owners("alice", 1));
173  env.require(balance("carol", USD(0)));
174  env.require(owners("carol", carolsOfferCount - 599));
175  env.require(balance("evita", USD(evitasOfferCount + 1)));
176  env.require(owners("evita", evitasOfferCount + 1));
177 
178  // Dan offers to buy maxConsumed + 50 XRP USD. He removes all of
179  // Carol's remaining offers as unfunded, then takes
180  // (maxConsumed - 100) USD from Evita's, hitting the crossing limit.
181  env(offer("dan", USD(maxConsumed + 50), XRP(maxConsumed + 50)));
182  env.require(balance("dan", USD(maxConsumed - 100)));
183  env.require(owners("dan", 2));
184  env.require(balance("alice", USD(600)));
185  env.require(owners("alice", 1));
186  env.require(balance("carol", USD(0)));
187  env.require(owners("carol", 1));
188  env.require(balance("evita", USD(150)));
189  env.require(owners("evita", 150));
190  }
191 
192  void
194  {
195  testcase("Auto Bridged Limits Taker");
196 
197  using namespace jtx;
198  Env env(*this, features);
199 
200  auto const gw = Account("gateway");
201  auto const USD = gw["USD"];
202  auto const EUR = gw["EUR"];
203 
204  env.fund(XRP(100000000), gw, "alice", "bob", "carol", "dan", "evita");
205 
206  env.trust(USD(2000), "alice");
207  env(pay(gw, "alice", USD(2000)));
208  env.trust(USD(1000), "carol");
209  env(pay(gw, "carol", USD(3)));
210  env.trust(USD(1000), "evita");
211  env(pay(gw, "evita", USD(1000)));
212 
213  n_offers(env, 302, "alice", EUR(2), XRP(1));
214  n_offers(env, 300, "alice", XRP(1), USD(4));
215  n_offers(env, 497, "carol", XRP(1), USD(3));
216  n_offers(env, 1001, "evita", EUR(1), USD(1));
217 
218  // Bob offers to buy 2000 USD for 2000 EUR, even though he only has
219  // 1000 EUR.
220  // 1. He spends 600 EUR taking Alice's auto-bridged offers and
221  // gets 1200 USD for that.
222  // 2. He spends another 2 EUR taking one of Alice's EUR->XRP and
223  // one of Carol's XRP-USD offers. He gets 3 USD for that.
224  // 3. The remainder of Carol's offers are now unfunded. We've
225  // consumed 602 offers so far. We now chew through 398 more
226  // of Carol's unfunded offers until we hit the 1000 offer limit.
227  // This sets have_bridge to false -- we will handle no more
228  // bridged offers.
229  // 4. However, have_direct is still true. So we go around one more
230  // time and take one of Evita's offers.
231  // 5. After taking one of Evita's offers we notice (again) that our
232  // offer count was exceeded. So we completely stop after taking
233  // one of Evita's offers.
234  env.trust(EUR(10000), "bob");
235  env.close();
236  env(pay(gw, "bob", EUR(1000)));
237  env.close();
238  env(offer("bob", USD(2000), EUR(2000)));
239  env.require(balance("bob", USD(1204)));
240  env.require(balance("bob", EUR(397)));
241 
242  env.require(balance("alice", USD(800)));
243  env.require(balance("alice", EUR(602)));
244  env.require(offers("alice", 1));
245  env.require(owners("alice", 3));
246 
247  env.require(balance("carol", USD(0)));
248  env.require(balance("carol", EUR(none)));
249  env.require(offers("carol", 100));
250  env.require(owners("carol", 101));
251 
252  env.require(balance("evita", USD(999)));
253  env.require(balance("evita", EUR(1)));
254  env.require(offers("evita", 1000));
255  env.require(owners("evita", 1002));
256 
257  // Dan offers to buy 900 EUR for 900 USD.
258  // 1. He removes all 100 of Carol's remaining unfunded offers.
259  // 2. Then takes 850 USD from Evita's offers.
260  // 3. Consuming 850 of Evita's funded offers hits the crossing
261  // limit. So Dan's offer crossing stops even though he would
262  // be willing to take another 50 of Evita's offers.
263  env.trust(EUR(10000), "dan");
264  env.close();
265  env(pay(gw, "dan", EUR(1000)));
266  env.close();
267 
268  env(offer("dan", USD(900), EUR(900)));
269  env.require(balance("dan", USD(850)));
270  env.require(balance("dan", EUR(150)));
271 
272  env.require(balance("alice", USD(800)));
273  env.require(balance("alice", EUR(602)));
274  env.require(offers("alice", 1));
275  env.require(owners("alice", 3));
276 
277  env.require(balance("carol", USD(0)));
278  env.require(balance("carol", EUR(none)));
279  env.require(offers("carol", 0));
280  env.require(owners("carol", 1));
281 
282  env.require(balance("evita", USD(149)));
283  env.require(balance("evita", EUR(851)));
284  env.require(offers("evita", 150));
285  env.require(owners("evita", 152));
286  }
287 
288  void
290  {
291  testcase("Auto Bridged Limits FlowCross");
292 
293  // If any book step in a payment strand consumes 1000 offers, the
294  // liquidity from the offers is used, but that strand will be marked as
295  // dry for the remainder of the transaction.
296 
297  using namespace jtx;
298 
299  auto const gw = Account("gateway");
300  auto const alice = Account("alice");
301  auto const bob = Account("bob");
302  auto const carol = Account("carol");
303 
304  auto const USD = gw["USD"];
305  auto const EUR = gw["EUR"];
306 
307  // There are two almost identical tests. There is a strand with a large
308  // number of unfunded offers that will cause the strand to be marked dry
309  // even though there will still be liquidity available on that strand.
310  // In the first test, the strand has the best initial quality. In the
311  // second test the strand does not have the best quality (the
312  // implementation has to handle this case correct and not mark the
313  // strand dry until the liquidity is actually used)
314  {
315  Env env(*this, features);
316 
317  env.fund(XRP(100000000), gw, alice, bob, carol);
318 
319  env.trust(USD(4000), alice);
320  env(pay(gw, alice, USD(4000)));
321  env.trust(USD(1000), carol);
322  env(pay(gw, carol, USD(3)));
323 
324  // Notice the strand with the 800 unfunded offers has the initial
325  // best quality
326  n_offers(env, 2000, alice, EUR(2), XRP(1));
327  n_offers(env, 300, alice, XRP(1), USD(4));
328  n_offers(
329  env, 801, carol, XRP(1), USD(3)); // only one offer is funded
330  n_offers(env, 1000, alice, XRP(1), USD(3));
331 
332  n_offers(env, 1, alice, EUR(500), USD(500));
333 
334  // Bob offers to buy 2000 USD for 2000 EUR; He starts with 2000 EUR
335  // 1. The best quality is the autobridged offers that take 2 EUR
336  // and give 4 USD.
337  // Bob spends 600 EUR and receives 1200 USD.
338  //
339  // 2. The best quality is the autobridged offers that take 2 EUR
340  // and give 3 USD.
341  // a. One of Carol's offers is taken. This leaves her other
342  // offers unfunded.
343  // b. Carol's remaining 800 offers are consumed as unfunded.
344  // c. 199 of alice's XRP(1) to USD(3) offers are consumed.
345  // A book step is allowed to consume a maxium of 1000 offers
346  // at a given quality, and that limit is now reached.
347  // d. Now the strand is dry, even though there are still funded
348  // XRP(1) to USD(3) offers available. Bob has spent 400 EUR and
349  // received 600 USD in this step. (200 funded offers consumed
350  // 800 unfunded offers)
351  // 3. The best is the non-autobridged offers that takes 500 EUR and
352  // gives 500 USD.
353  // Bob has 2000 EUR, and has spent 600+400=1000 EUR. He has 1000
354  // left. Bob spent 500 EUR and receives 500 USD.
355  // In total: Bob spent EUR(600 + 400 + 500) = EUR(1500). He started
356  // with 2000 so has 500 remaining
357  // Bob received USD(1200 + 600 + 500) = USD(2300).
358  // Alice spent 300*4 + 199*3 + 500 = 2297 USD. She started
359  // with 4000 so has 1703 USD remaining. Alice received
360  // 600 + 400 + 500 = 1500 EUR
361  env.trust(EUR(10000), bob);
362  env.close();
363  env(pay(gw, bob, EUR(2000)));
364  env.close();
365  env(offer(bob, USD(4000), EUR(4000)));
366  env.close();
367 
368  env.require(balance(bob, USD(2300)));
369  env.require(balance(bob, EUR(500)));
370  env.require(offers(bob, 1));
371  env.require(owners(bob, 3));
372 
373  env.require(balance(alice, USD(1703)));
374  env.require(balance(alice, EUR(1500)));
375  auto const numAOffers =
376  2000 + 300 + 1000 + 1 - (2 * 300 + 2 * 199 + 1 + 1);
377  env.require(offers(alice, numAOffers));
378  env.require(owners(alice, numAOffers + 2));
379 
380  env.require(offers(carol, 0));
381  }
382  {
383  Env env(*this, features);
384 
385  env.fund(XRP(100000000), gw, alice, bob, carol);
386 
387  env.trust(USD(4000), alice);
388  env(pay(gw, alice, USD(4000)));
389  env.trust(USD(1000), carol);
390  env(pay(gw, carol, USD(3)));
391 
392  // Notice the strand with the 800 unfunded offers does not have the
393  // initial best quality
394  n_offers(env, 1, alice, EUR(1), USD(10));
395  n_offers(env, 2000, alice, EUR(2), XRP(1));
396  n_offers(env, 300, alice, XRP(1), USD(4));
397  n_offers(
398  env, 801, carol, XRP(1), USD(3)); // only one offer is funded
399  n_offers(env, 1000, alice, XRP(1), USD(3));
400 
401  n_offers(env, 1, alice, EUR(499), USD(499));
402 
403  // Bob offers to buy 2000 USD for 2000 EUR; He starts with 2000 EUR
404  // 1. The best quality is the offer that takes 1 EUR and gives 10
405  // USD
406  // Bob spends 1 EUR and receives 10 USD.
407  //
408  // 2. The best quality is the autobridged offers that takes 2 EUR
409  // and gives 4 USD.
410  // Bob spends 600 EUR and receives 1200 USD.
411  //
412  // 3. The best quality is the autobridged offers that takes 2 EUR
413  // and gives 3 USD.
414  // a. One of Carol's offers is taken. This leaves her other
415  // offers unfunded.
416  // b. Carol's remaining 800 offers are consumed as unfunded.
417  // c. 199 of alice's XRP(1) to USD(3) offers are consumed.
418  // A book step is allowed to consume a maxium of 1000 offers
419  // at a given quality, and that limit is now reached.
420  // d. Now the strand is dry, even though there are still funded
421  // XRP(1) to USD(3) offers available. Bob has spent 400 EUR and
422  // received 600 USD in this step. (200 funded offers consumed
423  // 800 unfunded offers)
424  // 4. The best is the non-autobridged offers that takes 499 EUR and
425  // gives 499 USD.
426  // Bob has 2000 EUR, and has spent 1+600+400=1001 EUR. He has
427  // 999 left. Bob spent 499 EUR and receives 499 USD.
428  // In total: Bob spent EUR(1 + 600 + 400 + 499) = EUR(1500). He
429  // started with 2000 so has 500 remaining
430  // Bob received USD(10 + 1200 + 600 + 499) = USD(2309).
431  // Alice spent 10 + 300*4 + 199*3 + 499 = 2306 USD. She
432  // started with 4000 so has 1704 USD remaining. Alice
433  // received 600 + 400 + 500 = 1500 EUR
434  env.trust(EUR(10000), bob);
435  env.close();
436  env(pay(gw, bob, EUR(2000)));
437  env.close();
438  env(offer(bob, USD(4000), EUR(4000)));
439  env.close();
440 
441  env.require(balance(bob, USD(2309)));
442  env.require(balance(bob, EUR(500)));
443  env.require(offers(bob, 1));
444  env.require(owners(bob, 3));
445 
446  env.require(balance(alice, USD(1694)));
447  env.require(balance(alice, EUR(1500)));
448  auto const numAOffers =
449  1 + 2000 + 300 + 1000 + 1 - (1 + 2 * 300 + 2 * 199 + 1 + 1);
450  env.require(offers(alice, numAOffers));
451  env.require(owners(alice, numAOffers + 2));
452 
453  env.require(offers(carol, 0));
454  }
455  }
456 
457  void
459  {
460  // Taker and FlowCross are too different in the way they handle
461  // autobridging to make one test suit both approaches.
462  //
463  // o Taker alternates between books, completing one full increment
464  // before returning to make another pass.
465  //
466  // o FlowCross extracts as much as possible in one book at one Quality
467  // before proceeding to the other book. This reduces the number of
468  // times we change books.
469  //
470  // So the tests for the two forms of autobridging are separate.
471  if (features[featureFlowCross])
473  else
474  testAutoBridgedLimitsTaker(features);
475  }
476 
477  void
479  {
480  testcase("Offer Overflow");
481 
482  using namespace jtx;
483 
484  auto const gw = Account("gateway");
485  auto const alice = Account("alice");
486  auto const bob = Account("bob");
487 
488  auto const USD = gw["USD"];
489 
490  Env env(*this, features);
491 
492  env.fund(XRP(100000000), gw, alice, bob);
493 
494  env.trust(USD(8000), alice);
495  env.trust(USD(8000), bob);
496  env.close();
497 
498  env(pay(gw, alice, USD(8000)));
499  env.close();
500 
501  // The new flow cross handles consuming excessive offers differently
502  // than the old offer crossing code. In the old code, the total number
503  // of consumed offers is tracked, and the crossings will stop after this
504  // limit is hit. In the new code, the number of offers is tracked per
505  // offerbook and per quality. This test shows how they can differ. Set
506  // up a book with many offers. At each quality keep the number of offers
507  // below the limit. However, if all the offers are consumed it would
508  // create a tecOVERSIZE error.
509  n_offers(env, 998, alice, XRP(1.00), USD(1));
510  n_offers(env, 998, alice, XRP(0.99), USD(1));
511  n_offers(env, 998, alice, XRP(0.98), USD(1));
512  n_offers(env, 998, alice, XRP(0.97), USD(1));
513  n_offers(env, 998, alice, XRP(0.96), USD(1));
514  n_offers(env, 998, alice, XRP(0.95), USD(1));
515 
516  bool const withFlowCross = features[featureFlowCross];
517  env(offer(bob, USD(8000), XRP(8000)),
518  ter(withFlowCross ? TER{tecOVERSIZE} : tesSUCCESS));
519  env.close();
520 
521  env.require(balance(bob, USD(withFlowCross ? 0 : 850)));
522  }
523 
524  void
525  run() override
526  {
527  auto testAll = [this](FeatureBitset features) {
528  testStepLimit(features);
529  testCrossingLimit(features);
530  testStepAndCrossingLimit(features);
531  testAutoBridgedLimits(features);
532  testOfferOverflow(features);
533  };
534  using namespace jtx;
535  auto const sa = supported_amendments();
536  testAll(sa - featureFlowCross);
537  testAll(sa);
538  }
539 };
540 
541 BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, tx, ripple, 10);
542 
543 } // namespace test
544 } // namespace ripple
ripple::sfOwnerCount
const SF_UINT32 sfOwnerCount
ripple::test::jtx::XRP
const XRP_t XRP
Converts to XRP Issue or STAmount.
Definition: amount.cpp:105
ripple::test::jtx::ter
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:33
ripple::test::jtx::owners
Match the number of items in the account's owner directory.
Definition: owners.h:69
ripple::test::jtx::Env::require
void require(Args const &... args)
Check a set of requirements.
Definition: Env.h:466
ripple::test::jtx::balance
A balance matches.
Definition: balance.h:38
ripple::CashFilter::none
@ none
ripple::QualityDirection::in
@ in
ripple::test::jtx::Env::trust
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:250
ripple::tecOVERSIZE
@ tecOVERSIZE
Definition: TER.h:272
ripple::test::BEAST_DEFINE_TESTSUITE_MANUAL_PRIO
BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, tx, ripple, 10)
ripple::QualityDirection::out
@ out
ripple::test::CrossingLimits_test::testAutoBridgedLimits
void testAutoBridgedLimits(FeatureBitset features)
Definition: CrossingLimits_test.cpp:458
ripple::TERSubset< CanCvtToTER >
ripple::test::CrossingLimits_test::n_offers
void n_offers(jtx::Env &env, std::size_t n, jtx::Account const &account, STAmount const &in, STAmount const &out)
Definition: CrossingLimits_test.cpp:29
ripple::STAmount
Definition: STAmount.h:42
ripple::test::CrossingLimits_test::testCrossingLimit
void testCrossingLimit(FeatureBitset features)
Definition: CrossingLimits_test.cpp:88
ripple::test::jtx::supported_amendments
FeatureBitset supported_amendments()
Definition: Env.h:70
ripple::test::CrossingLimits_test::testStepAndCrossingLimit
void testStepAndCrossingLimit(FeatureBitset features)
Definition: CrossingLimits_test.cpp:128
ripple::test::CrossingLimits_test::run
void run() override
Definition: CrossingLimits_test.cpp:525
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test::CrossingLimits_test
Definition: CrossingLimits_test.cpp:25
ripple::test::jtx::pay
Json::Value pay(Account const &account, Account const &to, AnyAmount amount)
Create a payment.
Definition: pay.cpp:29
ripple::test::CrossingLimits_test::testStepLimit
void testStepLimit(FeatureBitset features)
Definition: CrossingLimits_test.cpp:48
ripple::test::jtx::Env::close
bool close(NetClock::time_point closeTime, boost::optional< std::chrono::milliseconds > consensusDelay=boost::none)
Close and advance the ledger.
Definition: Env.cpp:121
ripple::test::jtx::Env::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:219
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:207
ripple::FeatureBitset
Definition: Feature.h:156
std::size_t
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition: Account.h:37
ripple::test::CrossingLimits_test::testAutoBridgedLimitsTaker
void testAutoBridgedLimitsTaker(FeatureBitset features)
Definition: CrossingLimits_test.cpp:193
ripple::test::CrossingLimits_test::testOfferOverflow
void testOfferOverflow(FeatureBitset features)
Definition: CrossingLimits_test.cpp:478
ripple::featureFlowCross
const uint256 featureFlowCross
Definition: Feature.cpp:166
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:216
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:115
ripple::test::CrossingLimits_test::testAutoBridgedLimitsFlowCross
void testAutoBridgedLimitsFlowCross(FeatureBitset features)
Definition: CrossingLimits_test.cpp:289
ripple::test::jtx::owner_count
Definition: owners.h:49