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