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  // The implementation allows any single step to consume at most 1000
316  // offers. With the `FlowSortStrands` feature enabled, if the total
317  // number of offers consumed by all the steps combined exceeds 1500, the
318  // payment stops.
319  {
320  Env env(*this, features);
321 
322  env.fund(XRP(100000000), gw, alice, bob, carol);
323 
324  env.trust(USD(4000), alice);
325  env(pay(gw, alice, USD(4000)));
326  env.trust(USD(1000), carol);
327  env(pay(gw, carol, USD(3)));
328 
329  // Notice the strand with the 800 unfunded offers has the initial
330  // best quality
331  n_offers(env, 2000, alice, EUR(2), XRP(1));
332  n_offers(env, 100, alice, XRP(1), USD(4));
333  n_offers(
334  env, 801, carol, XRP(1), USD(3)); // only one offer is funded
335  n_offers(env, 1000, alice, XRP(1), USD(3));
336 
337  n_offers(env, 1, alice, EUR(500), USD(500));
338 
339  // Bob offers to buy 2000 USD for 2000 EUR; He starts with 2000 EUR
340  // 1. The best quality is the autobridged offers that take 2 EUR
341  // and give 4 USD.
342  // Bob spends 200 EUR and receives 400 USD.
343  // 100 EUR->XRP offers consumed.
344  // 100 XRP->USD offers consumed.
345  // 200 total offers consumed.
346  //
347  // 2. The best quality is the autobridged offers that take 2 EUR
348  // and give 3 USD.
349  // a. One of Carol's offers is taken. This leaves her other
350  // offers unfunded.
351  // b. Carol's remaining 800 offers are consumed as unfunded.
352  // c. 199 of alice's XRP(1) to USD(3) offers are consumed.
353  // A book step is allowed to consume a maxium of 1000 offers
354  // at a given quality, and that limit is now reached.
355  // d. Now the strand is dry, even though there are still funded
356  // XRP(1) to USD(3) offers available.
357  // Bob has spent 400 EUR and received 600 USD in this step.
358  // 200 EUR->XRP offers consumed
359  // 800 unfunded XRP->USD offers consumed
360  // 200 funded XRP->USD offers consumed (1 carol, 199 alice)
361  // 1400 total offers consumed so far (100 left before the
362  // limit)
363  // 3. The best is the non-autobridged offers that takes 500 EUR and
364  // gives 500 USD.
365  // Bob started with 2000 EUR
366  // Bob spent 500 EUR (100+400)
367  // Bob has 1500 EUR left
368  // In this step:
369  // Bob spents 500 EUR and receives 500 USD.
370  // In total:
371  // Bob spent 1100 EUR (200 + 400 + 500)
372  // Bob has 900 EUR remaining (2000 - 1100)
373  // Bob received 1500 USD (400 + 600 + 500)
374  // Alice spent 1497 USD (100*4 + 199*3 + 500)
375  // Alice has 2503 remaining (4000 - 1497)
376  // Alice received 1100 EUR (200 + 400 + 500)
377  env.trust(EUR(10000), bob);
378  env.close();
379  env(pay(gw, bob, EUR(2000)));
380  env.close();
381  env(offer(bob, USD(4000), EUR(4000)));
382  env.close();
383 
384  env.require(balance(bob, USD(1500)));
385  env.require(balance(bob, EUR(900)));
386  env.require(offers(bob, 1));
387  env.require(owners(bob, 3));
388 
389  env.require(balance(alice, USD(2503)));
390  env.require(balance(alice, EUR(1100)));
391  auto const numAOffers =
392  2000 + 100 + 1000 + 1 - (2 * 100 + 2 * 199 + 1 + 1);
393  env.require(offers(alice, numAOffers));
394  env.require(owners(alice, numAOffers + 2));
395 
396  env.require(offers(carol, 0));
397  }
398  {
399  Env env(*this, features);
400 
401  env.fund(XRP(100000000), gw, alice, bob, carol);
402 
403  env.trust(USD(4000), alice);
404  env(pay(gw, alice, USD(4000)));
405  env.trust(USD(1000), carol);
406  env(pay(gw, carol, USD(3)));
407 
408  // Notice the strand with the 800 unfunded offers does not have the
409  // initial best quality
410  n_offers(env, 1, alice, EUR(1), USD(10));
411  n_offers(env, 2000, alice, EUR(2), XRP(1));
412  n_offers(env, 100, alice, XRP(1), USD(4));
413  n_offers(
414  env, 801, carol, XRP(1), USD(3)); // only one offer is funded
415  n_offers(env, 1000, alice, XRP(1), USD(3));
416 
417  n_offers(env, 1, alice, EUR(499), USD(499));
418 
419  // Bob offers to buy 2000 USD for 2000 EUR; He starts with 2000 EUR
420  // 1. The best quality is the offer that takes 1 EUR and gives 10
421  // USD
422  // Bob spends 1 EUR and receives 10 USD.
423  //
424  // 2. The best quality is the autobridged offers that takes 2 EUR
425  // and gives 4 USD.
426  // Bob spends 200 EUR and receives 400 USD.
427  //
428  // 3. The best quality is the autobridged offers that takes 2 EUR
429  // and gives 3 USD.
430  // a. One of Carol's offers is taken. This leaves her other
431  // offers unfunded.
432  // b. Carol's remaining 800 offers are consumed as unfunded.
433  // c. 199 of alice's XRP(1) to USD(3) offers are consumed.
434  // A book step is allowed to consume a maxium of 1000 offers
435  // at a given quality, and that limit is now reached.
436  // d. Now the strand is dry, even though there are still funded
437  // XRP(1) to USD(3) offers available. Bob has spent 400 EUR and
438  // received 600 USD in this step. (200 funded offers consumed
439  // 800 unfunded offers)
440  // 4. The best is the non-autobridged offers that takes 499 EUR and
441  // gives 499 USD.
442  // Bob has 2000 EUR, and has spent 1+200+400=601 EUR. He has
443  // 1399 left. Bob spent 499 EUR and receives 499 USD.
444  // In total: Bob spent EUR(1 + 200 + 400 + 499) = EUR(1100). He
445  // started with 2000 so has 900 remaining
446  // Bob received USD(10 + 400 + 600 + 499) = USD(1509).
447  // Alice spent 10 + 100*4 + 199*3 + 499 = 1506 USD. She
448  // started with 4000 so has 2494 USD remaining. Alice
449  // received 200 + 400 + 500 = 1100 EUR
450  env.trust(EUR(10000), bob);
451  env.close();
452  env(pay(gw, bob, EUR(2000)));
453  env.close();
454  env(offer(bob, USD(4000), EUR(4000)));
455  env.close();
456 
457  env.require(balance(bob, USD(1509)));
458  env.require(balance(bob, EUR(900)));
459  env.require(offers(bob, 1));
460  env.require(owners(bob, 3));
461 
462  env.require(balance(alice, USD(2494)));
463  env.require(balance(alice, EUR(1100)));
464  auto const numAOffers =
465  1 + 2000 + 100 + 1000 + 1 - (1 + 2 * 100 + 2 * 199 + 1 + 1);
466  env.require(offers(alice, numAOffers));
467  env.require(owners(alice, numAOffers + 2));
468 
469  env.require(offers(carol, 0));
470  }
471  }
472 
473  void
475  {
476  // Taker and FlowCross are too different in the way they handle
477  // autobridging to make one test suit both approaches.
478  //
479  // o Taker alternates between books, completing one full increment
480  // before returning to make another pass.
481  //
482  // o FlowCross extracts as much as possible in one book at one Quality
483  // before proceeding to the other book. This reduces the number of
484  // times we change books.
485  //
486  // So the tests for the two forms of autobridging are separate.
487  if (features[featureFlowCross])
489  else
490  testAutoBridgedLimitsTaker(features);
491  }
492 
493  void
495  {
496  testcase("Offer Overflow");
497 
498  using namespace jtx;
499 
500  auto const gw = Account("gateway");
501  auto const alice = Account("alice");
502  auto const bob = Account("bob");
503 
504  auto const USD = gw["USD"];
505 
506  Env env(*this, features);
507 
508  env.fund(XRP(100000000), gw, alice, bob);
509 
510  env.trust(USD(8000), alice);
511  env.trust(USD(8000), bob);
512  env.close();
513 
514  env(pay(gw, alice, USD(8000)));
515  env.close();
516 
517  // The new flow cross handles consuming excessive offers differently
518  // than the old offer crossing code. In the old code, the total number
519  // of consumed offers is tracked, and the crossings will stop after this
520  // limit is hit. In the new code, the number of offers is tracked per
521  // offerbook and per quality. This test shows how they can differ. Set
522  // up a book with many offers. At each quality keep the number of offers
523  // below the limit. However, if all the offers are consumed it would
524  // create a tecOVERSIZE error.
525 
526  // The featureFlowSortStrands introduces a way of tracking the total
527  // number of consumed offers; with this feature the transaction no
528  // longer fails with a tecOVERSIZE error.
529  // The implementation allows any single step to consume at most 1000
530  // offers. With the `FlowSortStrands` feature enabled, if the total
531  // number of offers consumed by all the steps combined exceeds 1500, the
532  // payment stops. Since the first set of offers consumes 998 offers, the
533  // second set will consume 998, which is not over the limit and the
534  // payment stops. So 2*998, or 1996 is the expected value when
535  // `FlowSortStrands` is enabled.
536  n_offers(env, 998, alice, XRP(1.00), USD(1));
537  n_offers(env, 998, alice, XRP(0.99), USD(1));
538  n_offers(env, 998, alice, XRP(0.98), USD(1));
539  n_offers(env, 998, alice, XRP(0.97), USD(1));
540  n_offers(env, 998, alice, XRP(0.96), USD(1));
541  n_offers(env, 998, alice, XRP(0.95), USD(1));
542 
543  bool const withFlowCross = features[featureFlowCross];
544  bool const withSortStrands = features[featureFlowSortStrands];
545 
546  auto const expectedTER = [&]() -> TER {
547  if (withFlowCross && !withSortStrands)
548  return TER{tecOVERSIZE};
549  return tesSUCCESS;
550  }();
551 
552  env(offer(bob, USD(8000), XRP(8000)), ter(expectedTER));
553  env.close();
554 
555  auto const expectedUSD = [&] {
556  if (!withFlowCross)
557  return USD(850);
558  if (!withSortStrands)
559  return USD(0);
560  return USD(1996);
561  }();
562 
563  env.require(balance(bob, expectedUSD));
564  }
565 
566  void
567  run() override
568  {
569  auto testAll = [this](FeatureBitset features) {
570  testStepLimit(features);
571  testCrossingLimit(features);
572  testStepAndCrossingLimit(features);
573  testAutoBridgedLimits(features);
574  testOfferOverflow(features);
575  };
576  using namespace jtx;
577  auto const sa = supported_amendments();
578  testAll(sa);
579  testAll(sa - featureFlowSortStrands);
581  }
582 };
583 
584 BEAST_DEFINE_TESTSUITE_MANUAL_PRIO(CrossingLimits, tx, ripple, 10);
585 
586 } // namespace test
587 } // 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::QualityDirection::in
@ in
ripple::test::jtx::Env::trust
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition: Env.cpp:259
ripple::tecOVERSIZE
@ tecOVERSIZE
Definition: TER.h:278
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:474
ripple::JsonOptions::none
@ none
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::test::jtx::Env::close
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Definition: Env.cpp:121
ripple::STAmount
Definition: STAmount.h:45
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:567
ripple::featureFlowSortStrands
const uint256 featureFlowSortStrands
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::fund
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition: Env.cpp:228
ripple::test::jtx::Env::le
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:216
ripple::FeatureBitset
Definition: Feature.h:113
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:494
ripple::featureFlowCross
const uint256 featureFlowCross
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:222
ripple::test::jtx::Env
A transaction testing environment.
Definition: Env.h:116
ripple::test::CrossingLimits_test::testAutoBridgedLimitsFlowCross
void testAutoBridgedLimitsFlowCross(FeatureBitset features)
Definition: CrossingLimits_test.cpp:289
ripple::test::jtx::owner_count
Definition: owners.h:49