xrpld
Loading...
Searching...
No Matches
PayStrandMPT_test.cpp
1
2#include <test/jtx/Account.h>
3#include <test/jtx/Env.h>
4#include <test/jtx/TestHelpers.h>
5#include <test/jtx/amount.h>
6#include <test/jtx/balance.h>
7#include <test/jtx/mpt.h>
8#include <test/jtx/offer.h>
9#include <test/jtx/paths.h>
10#include <test/jtx/pay.h>
11#include <test/jtx/sendmax.h>
12#include <test/jtx/ter.h>
13#include <test/jtx/txflags.h>
14
15#include <xrpl/beast/unit_test/suite.h>
16#include <xrpl/ledger/ApplyView.h>
17#include <xrpl/ledger/PaymentSandbox.h>
18#include <xrpl/protocol/AccountID.h>
19#include <xrpl/protocol/Asset.h>
20#include <xrpl/protocol/Book.h>
21#include <xrpl/protocol/Feature.h>
22#include <xrpl/protocol/Issue.h>
23#include <xrpl/protocol/STAmount.h>
24#include <xrpl/protocol/STPathSet.h>
25#include <xrpl/protocol/TER.h>
26#include <xrpl/protocol/TxFlags.h>
27#include <xrpl/protocol/UintTypes.h>
28#include <xrpl/tx/paths/RippleCalc.h>
29#include <xrpl/tx/paths/detail/Steps.h>
30#include <xrpl/tx/transactors/dex/AMMContext.h>
31
32#include <optional>
33#include <type_traits>
34
35namespace xrpl::test {
36
38{
40 makeEndpointStep(jtx::Account const& src, jtx::Account const& dst, jtx::IOU const& iou)
41 {
42 return jtx::DirectStepInfo{.src = src, .dst = dst, .currency = iou.currency};
43 }
45 makeEndpointStep(jtx::Account const& src, jtx::Account const& dst, jtx::MPT const& mpt)
46 {
47 return jtx::MPTEndpointStepInfo{.src = src, .dst = dst, .mptid = mpt.mpt()};
48 }
49
50 void
52 {
53 testcase("To Strand");
54
55 using namespace jtx;
56
57 auto const alice = Account("alice");
58 auto const bob = Account("bob");
59 auto const carol = Account("carol");
60 auto const gw = Account("gw");
61
62 using M = MPTEndpointStepInfo;
63 using B = xrpl::Book;
64 using XRPS = XRPEndpointStepInfo;
65
66 AMMContext ammContext(alice, false);
67
68 auto test = [&, this](
69 jtx::Env& env,
70 Asset const& deliver,
71 std::optional<Asset> const& sendMaxIssue,
72 STPath const& path,
73 TER expTer,
74 auto&&... expSteps) {
75 auto [ter, strand] = toStrand(
76 *env.current(),
77 alice,
78 bob,
79 deliver,
80 std::nullopt,
81 sendMaxIssue,
82 path,
83 true,
85 ammContext,
86 std::nullopt,
87 env.app().getLogs().journal("Flow"));
88 BEAST_EXPECT(ter == expTer);
89 if (sizeof...(expSteps) != 0)
90 BEAST_EXPECT(jtx::equal(strand, std::forward<decltype(expSteps)>(expSteps)...));
91 };
92
93 {
94 auto const testMultiToken = [&](auto&& issue1, auto&& issue2) {
95 Env env(*this, features);
96 env.fund(XRP(10'000), alice, bob, gw);
97 MPT const usd =
98 MPTTester({.env = env, .issuer = gw, .holders = {alice, bob}, .maxAmt = 1'000});
99 auto const bobUSD = issue1({
100 .env = env,
101 .token = "USD",
102 .issuer = bob,
103 .holders = {alice},
104 .limit = 1'000,
105 });
106 MPT const eur =
107 MPTTester({.env = env, .issuer = gw, .holders = {alice, bob}, .maxAmt = 1'000});
108 auto const bobEUR = issue2({
109 .env = env,
110 .token = "EUR",
111 .issuer = bob,
112 .holders = {alice},
113 .limit = 1'000,
114 });
115 env(pay(gw, alice, eur(100)));
116
117 {
118 // Original test is
119 // STPath({ipe(bob["USD"]), cpe(EUR.currency)});
120 // which ripples through same currency, different issuer.
121 // This results in 5 steps:
122 // 1 DirectStep alice -> gw EUR/gw
123 // 2 Book EUR/gw USD/bob
124 // 3 Book USD/bob EUR/bob
125 // 4 Book EUR/bob XRP
126 // 5 XRPEndpoint
127 // This is somewhat equivalent path with MPT
128 STPath const path = STPath({ipe(bobUSD), ipe(bobEUR), cpe(xrpCurrency())});
129 auto [ter, _] = toStrand(
130 *env.current(),
131 alice,
132 alice,
133 /*deliver*/ xrpIssue(),
134 /*limitQuality*/ std::nullopt,
135 /*sendMaxIssue*/ eur,
136 path,
137 true,
139 ammContext,
140 std::nullopt,
141 env.app().getLogs().journal("Flow"));
142 (void)_;
143 BEAST_EXPECT(ter == tesSUCCESS);
144 }
145 {
146 STPath const path = STPath({ipe(usd), cpe(xrpCurrency())});
147 auto [ter, _] = toStrand(
148 *env.current(),
149 alice,
150 alice,
151 /*deliver*/ xrpIssue(),
152 /*limitQuality*/ std::nullopt,
153 /*sendMaxIssue*/ eur,
154 path,
155 true,
157 ammContext,
158 std::nullopt,
159 env.app().getLogs().journal("Flow"));
160 (void)_;
161 BEAST_EXPECT(ter == tesSUCCESS);
162 }
163 };
164 testHelper2TokensMix(testMultiToken);
165 }
166 {
167 auto const testMultiToken = [&](auto&& issue1, auto&& issue2) {
168 Env env(*this, features);
169 env.fund(XRP(10'000), alice, bob, carol, gw);
170 auto usd = issue1({.env = env, .token = "USD", .issuer = gw, .limit = 1'000});
171 using TUsd = std::decay_t<decltype(usd)>;
172 auto const eur = issue2({.env = env, .token = "EUR", .issuer = gw, .limit = 1'000});
173 using TEur = std::decay_t<decltype(eur)>;
174
175 auto const err = [&] {
176 if constexpr (std::is_same_v<TUsd, MPT>)
177 {
178 return tecNO_AUTH;
179 }
180 else
181 {
182 return terNO_LINE;
183 }
184 }();
185 test(env, usd, std::nullopt, STPath(), err);
186
187 if constexpr (std::is_same_v<TUsd, MPT>)
188 {
189 MPTTester(env, gw, usd).authorizeHolders({alice, bob, carol});
190 }
191 else
192 {
193 env.trust(usd(1'000), alice, bob, carol);
194 }
195
196 test(env, usd, std::nullopt, STPath(), tecPATH_DRY);
197
198 env(pay(gw, alice, usd(100)));
199 env(pay(gw, carol, usd(100)));
200
201 // Insert implied account
202 test(
203 env,
204 usd,
205 std::nullopt,
206 STPath(),
208 makeEndpointStep(alice, gw, usd),
209 makeEndpointStep(gw, bob, usd));
210 if constexpr (std::is_same_v<TEur, MPT>)
211 {
212 MPTTester(env, gw, eur).authorizeHolders({alice, bob});
213 }
214 else
215 {
216 env.trust(eur(1'000), alice, bob);
217 }
218
219 // Insert implied offer
220 test(
221 env,
222 eur,
223 usd,
224 STPath(),
226 makeEndpointStep(alice, gw, usd),
227 B{usd, eur, std::nullopt},
228 makeEndpointStep(gw, bob, eur));
229
230 // Path with explicit offer
231 test(
232 env,
233 eur,
234 usd,
235 STPath({ipe(eur)}),
237 makeEndpointStep(alice, gw, usd),
238 B{usd, eur, std::nullopt},
239 makeEndpointStep(gw, bob, eur));
240
241 // Path with XRP src currency
242 test(
243 env,
244 usd,
245 xrpIssue(),
246 STPath({ipe(usd)}),
248 XRPS{alice},
249 B{XRP, usd, std::nullopt},
250 makeEndpointStep(gw, bob, usd));
251
252 // Path with XRP dst currency.
253 test(
254 env,
255 xrpIssue(),
256 usd,
257 STPath({
260 }),
262 makeEndpointStep(alice, gw, usd),
263 B{usd, XRP, std::nullopt},
264 XRPS{bob});
265
266 // Path with XRP cross currency bridged payment
267 test(
268 env,
269 eur,
270 usd,
271 STPath({cpe(xrpCurrency())}),
273 makeEndpointStep(alice, gw, usd),
274 B{usd, XRP, std::nullopt},
275 B{XRP, eur, std::nullopt},
276 makeEndpointStep(gw, bob, eur));
277
278 // Create an offer with the same in/out issue
279 test(env, eur, usd, STPath({ipe(usd), ipe(eur)}), temBAD_PATH);
280
281 // The same offer can't appear more than once on a path
282 test(env, eur, usd, STPath({ipe(eur), ipe(usd), ipe(eur)}), temBAD_PATH_LOOP);
283 };
284 testHelper2TokensMix(testMultiToken);
285 }
286
287 {
288 // cannot have more than one offer with the same output issue
289
290 using namespace jtx;
291
292 auto const testMultiToken = [&](auto&& issue1, auto&& issue2) {
293 Env env(*this, features);
294
295 env.fund(XRP(10'000), alice, bob, carol, gw);
296
297 auto const usd = issue1({
298 .env = env,
299 .token = "USD",
300 .issuer = gw,
301 .holders = {alice, bob, carol},
302 .limit = 10'000,
303 });
304 auto const eur = issue2({
305 .env = env,
306 .token = "EUR",
307 .issuer = gw,
308 .holders = {alice, bob, carol},
309 .limit = 10'000,
310 });
311
312 env(pay(gw, bob, usd(100)));
313 env(pay(gw, bob, eur(100)));
314
315 env(offer(bob, XRP(100), usd(100)));
316 env(offer(bob, usd(100), eur(100)), Txflags(tfPassive));
317 env(offer(bob, eur(100), usd(100)), Txflags(tfPassive));
318
319 // payment path: XRP -> XRP/USD -> USD/EUR -> EUR/USD
320 env(pay(alice, carol, usd(100)),
321 Path(~usd, ~eur, ~usd),
322 Sendmax(XRP(200)),
323 Txflags(tfNoRippleDirect),
325 };
326 testHelper2TokensMix(testMultiToken);
327 }
328
329 {
330 // check global freeze
331 Env env(*this, features);
332 env.fund(XRP(10000), alice, bob, gw);
333 auto usdm = MPTTester({
334 .env = env,
335 .issuer = gw,
336 .holders = {alice, bob},
337 .flags = kMptDexFlags | tfMPTCanLock,
338 .maxAmt = 1'000,
339 });
340 MPT const usd = usdm;
341 env(pay(gw, alice, usd(100)));
342
343 // Account can't issue payments
344 usdm.set({.holder = alice, .flags = tfMPTLock});
345 test(env, usd, std::nullopt, STPath(), terLOCKED);
346 usdm.set({.holder = alice, .flags = tfMPTUnlock});
347 test(env, usd, std::nullopt, STPath(), tesSUCCESS);
348
349 // Account can not issue funds
350 usdm.set({.flags = tfMPTLock});
351 test(env, usd, std::nullopt, STPath(), terLOCKED);
352 usdm.set({.flags = tfMPTUnlock});
353 test(env, usd, std::nullopt, STPath(), tesSUCCESS);
354
355 // Account can not receive funds
356 usdm.set({.holder = bob, .flags = tfMPTLock});
357 test(env, usd, std::nullopt, STPath(), terLOCKED);
358 usdm.set({.holder = bob, .flags = tfMPTUnlock});
359 test(env, usd, std::nullopt, STPath(), tesSUCCESS);
360 }
361
362 {
363 // check no auth
364 // An account may require authorization to receive MPTs from an
365 // issuer
366 Env env(*this, features);
367 env.fund(XRP(10'000), alice, bob, gw);
368 auto usdm = MPTTester({
369 .env = env,
370 .issuer = gw,
371 .flags = kMptDexFlags | tfMPTRequireAuth,
372 .maxAmt = 1'000,
373 });
374 MPT const usd = usdm;
375
376 // Authorize alice but not bob
377 usdm.authorize({.account = alice});
378 usdm.authorize({.holder = alice});
379 env(pay(gw, alice, usd(100)));
380 env.require(Balance(alice, usd(100)));
381 test(env, usd, std::nullopt, STPath(), tecNO_AUTH);
382
383 // Check pure issue redeem still works
384 auto [ter, strand] = toStrand(
385 *env.current(),
386 alice,
387 gw,
388 usd,
389 std::nullopt,
390 std::nullopt,
391 STPath(),
392 true,
394 ammContext,
395 std::nullopt,
396 env.app().getLogs().journal("Flow"));
397 BEAST_EXPECT(ter == tesSUCCESS);
398 BEAST_EXPECT(equal(strand, M{alice, gw, usd}));
399 }
400
401 {
402 // last step xrp from offer
403 Env env(*this, features);
404 env.fund(XRP(10'000), alice, bob, gw);
405 MPT const usd =
406 MPTTester({.env = env, .issuer = gw, .holders = {alice, bob}, .maxAmt = 1'000});
407 env(pay(gw, alice, usd(100)));
408
409 // alice -> USD/XRP -> bob
410 STPath path;
411 path.emplaceBack(std::nullopt, xrpCurrency(), std::nullopt);
412
413 auto [ter, strand] = toStrand(
414 *env.current(),
415 alice,
416 bob,
417 XRP,
418 std::nullopt,
419 usd,
420 path,
421 false,
423 ammContext,
424 std::nullopt,
425 env.app().getLogs().journal("Flow"));
426 BEAST_EXPECT(ter == tesSUCCESS);
427 BEAST_EXPECT(
428 equal(strand, M{alice, gw, usd}, B{usd, xrpIssue(), std::nullopt}, XRPS{bob}));
429 }
430 }
431
432 void
434 {
435 using namespace jtx;
436 testcase("RIPD1373");
437
438 auto const alice = Account("alice");
439 auto const bob = Account("bob");
440 auto const carol = Account("carol");
441 auto const gw = Account("gw");
442
443 {
444 Env env(*this, features);
445
446 env.fund(XRP(10000), alice, bob, carol, gw);
447 MPT const usd = MPTTester(
448 {.env = env, .issuer = gw, .holders = {alice, bob, carol}, .maxAmt = 10'000});
449
450 env(pay(gw, bob, usd(100)));
451
452 env(offer(bob, XRP(100), usd(100)), Txflags(tfPassive));
453 env(offer(bob, usd(100), XRP(100)), Txflags(tfPassive));
454
455 // payment path: XRP -> XRP/USD -> USD/XRP
456 env(pay(alice, carol, XRP(100)),
457 Path(~usd, ~XRP),
458 Txflags(tfNoRippleDirect),
460 }
461
462 {
463 Env env(*this, features);
464
465 env.fund(XRP(10000), alice, bob, carol, gw);
466 MPT const usd = MPTTester(
467 {.env = env, .issuer = gw, .holders = {alice, bob, carol}, .maxAmt = 10'000});
468
469 env(pay(gw, bob, usd(100)));
470
471 env(offer(bob, XRP(100), usd(100)), Txflags(tfPassive));
472 env(offer(bob, usd(100), XRP(100)), Txflags(tfPassive));
473
474 // payment path: XRP -> XRP/USD -> USD/XRP
475 env(pay(alice, carol, XRP(100)),
476 Path(~usd, ~XRP),
477 Sendmax(XRP(200)),
478 Txflags(tfNoRippleDirect),
480 }
481 }
482
483 void
485 {
486 testcase("test loop");
487 using namespace jtx;
488
489 auto const alice = Account("alice");
490 auto const bob = Account("bob");
491 auto const carol = Account("carol");
492 auto const gw = Account("gw");
493 auto const eur = gw["EUR"];
494 auto const cny = gw["CNY"];
495
496 {
497 Env env(*this, features);
498
499 env.fund(XRP(10'000), alice, bob, carol, gw);
500 MPT const usd = MPTTester(
501 {.env = env, .issuer = gw, .holders = {alice, bob, carol}, .maxAmt = 10'000});
502
503 env(pay(gw, bob, usd(100)));
504 env(pay(gw, alice, usd(100)));
505
506 env(offer(bob, XRP(100), usd(100)), Txflags(tfPassive));
507 env(offer(bob, usd(100), XRP(100)), Txflags(tfPassive));
508
509 // payment path: USD -> USD/XRP -> XRP/USD
510 env(pay(alice, carol, usd(100)),
511 Sendmax(usd(100)),
512 Path(~XRP, ~usd),
513 Txflags(tfNoRippleDirect),
515 }
516 {
517 auto const testMultiToken = [&](auto&& issue1, auto&& issue2, auto&& issue3) {
518 Env env(*this, features);
519
520 env.fund(XRP(10'000), alice, bob, carol, gw);
521 auto const usd = issue1({
522 .env = env,
523 .token = "USD",
524 .issuer = gw,
525 .holders = {alice, bob, carol},
526 .limit = 10'000,
527 });
528 auto const eur = issue2({
529 .env = env,
530 .token = "EUR",
531 .issuer = gw,
532 .holders = {alice, bob, carol},
533 .limit = 10'000,
534 });
535 auto const cny = issue3({
536 .env = env,
537 .token = "CNY",
538 .issuer = gw,
539 .holders = {alice, bob, carol},
540 .limit = 10'000,
541 });
542
543 env(pay(gw, bob, usd(100)));
544 env(pay(gw, bob, eur(100)));
545 env(pay(gw, bob, cny(100)));
546
547 env(offer(bob, XRP(100), usd(100)), Txflags(tfPassive));
548 env(offer(bob, usd(100), eur(100)), Txflags(tfPassive));
549 env(offer(bob, eur(100), cny(100)), Txflags(tfPassive));
550
551 // payment path: XRP->XRP/USD->USD/EUR->USD/CNY
552 env(pay(alice, carol, cny(100)),
553 Sendmax(XRP(100)),
554 Path(~usd, ~eur, ~usd, ~cny),
555 Txflags(tfNoRippleDirect),
557 };
558 testHelper3TokensMix(testMultiToken);
559 }
560 }
561
562 void
564 {
565 testcase("test no account");
566 using namespace jtx;
567
568 auto const alice = Account("alice");
569 auto const bob = Account("bob");
570 auto const gw = Account("gw");
571
572 Env env(*this, features);
573 env.fund(XRP(10'000), alice, bob, gw);
574 MPT const usd = MPTTester({.env = env, .issuer = gw, .holders = {alice, bob}});
575
576 STAmount const sendMax{usd, 100, 1};
577 STAmount const noAccountAmount{MPTIssue{0, noAccount()}, 100, 1};
578 STAmount const deliver;
579 AccountID const srcAcc = alice.id();
580 AccountID const dstAcc = bob.id();
581 STPathSet const pathSet;
583 inputs.defaultPathsAllowed = true;
584 try
585 {
586 PaymentSandbox sb{env.current().get(), TapNone};
587 {
589 sb,
590 sendMax,
591 deliver,
592 dstAcc,
593 noAccount(),
594 pathSet,
595 std::nullopt,
596 env.app(),
597 &inputs);
598 BEAST_EXPECT(r.result() == temBAD_PATH);
599 }
600 {
602 sb,
603 sendMax,
604 deliver,
605 noAccount(),
606 srcAcc,
607 pathSet,
608 std::nullopt,
609 env.app(),
610 &inputs);
611 BEAST_EXPECT(r.result() == temBAD_PATH);
612 }
613 {
615 sb,
616 noAccountAmount,
617 deliver,
618 dstAcc,
619 srcAcc,
620 pathSet,
621 std::nullopt,
622 env.app(),
623 &inputs);
624 BEAST_EXPECT(r.result() == temBAD_PATH);
625 }
626 {
628 sb,
629 sendMax,
630 noAccountAmount,
631 dstAcc,
632 srcAcc,
633 pathSet,
634 std::nullopt,
635 env.app(),
636 &inputs);
637 BEAST_EXPECT(r.result() == temBAD_PATH);
638 }
639 }
640 catch (...)
641 {
642 this->fail();
643 }
644 }
645
646 void
647 run() override
648 {
649 using namespace jtx;
650 auto const sa = testableAmendments();
651 testToStrand(sa);
652
653 testRIPD1373(sa);
654
655 testLoop(sa);
656
657 testNoAccount(sa);
658 }
659};
660
661BEAST_DEFINE_TESTSUITE(PayStrandMPT, app, xrpl);
662
663} // namespace xrpl::test
A testsuite class.
Definition suite.h:52
void fail(String const &reason, char const *file, int line)
Record a failure.
Definition suite.h:554
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
Maintains AMM info per overall payment engine execution and individual iteration.
Definition AMMContext.h:17
Specifies an order book.
Definition Book.h:28
beast::Journal journal(std::string const &name)
Definition Log.cpp:137
A wrapper which makes credits unavailable to balances.
virtual Logs & getLogs()=0
static Output rippleCalculate(PaymentSandbox &view, STAmount const &saMaxAmountReq, STAmount const &saDstAmountReq, AccountID const &uDstAccountID, AccountID const &uSrcAccountID, STPathSet const &spsPaths, std::optional< UInt256 > const &domainID, ServiceRegistry &registry, Input const *const pInputs=nullptr)
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
A balance matches.
Definition balance.h:24
A transaction testing environment.
Definition Env.h:161
Application & app()
Definition Env.h:300
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Definition Env.cpp:323
PrettyAmount limit(Account const &account, Issue const &issue) const
Returns the IOU limit on an account.
Definition Env.cpp:254
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
Definition Env.cpp:354
void require(Args const &... args)
Check a set of requirements.
Definition Env.h:766
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Definition Env.h:377
Converts to IOU Issue or STAmount.
Test helper for creating, mutating, and asserting MPT and confidential MPT ledger state.
Definition mpt.h:512
void authorizeHolders(Holders const &holders, std::source_location const &loc=std::source_location::current())
Definition mpt.cpp:529
Converts to MPT Issue or STAmount.
xrpl::MPTID const & mpt() const
Add a path.
Definition paths.h:47
Sets the SendMax on a JTx.
Definition sendmax.h:16
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition ter.h:18
Set the flags on a JTx.
Definition txflags.h:14
T forward(T... args)
T is_same_v
auto const kMptDexFlags
Definition mpt.h:47
json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:14
void testHelper2TokensMix(TTester &&tester)
XrpT const XRP
Converts to XRP Issue or STAmount.
Definition amount.cpp:92
FeatureBitset testableAmendments()
Definition Env.h:92
void testHelper3TokensMix(TTester &&tester)
STPathElement cpe(PathAsset const &pa)
STPathElement ipe(Asset const &asset)
bool equal(STAmount const &sa1, STAmount const &sa2)
json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:14
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ terNO_LINE
Definition TER.h:221
@ terLOCKED
Definition TER.h:233
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition Issue.h:108
Currency const & xrpCurrency()
XRP currency.
Definition UintTypes.cpp:99
@ TapNone
Definition ApplyView.h:28
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
AccountID const & noAccount()
A placeholder for empty accounts.
@ temBAD_PATH
Definition TER.h:84
@ temBAD_SEND_XRP_PATHS
Definition TER.h:91
@ temBAD_SEND_XRP_MAX
Definition TER.h:88
@ temBAD_PATH_LOOP
Definition TER.h:85
TERSubset< CanCvtToTER > TER
Definition TER.h:657
AccountID const & xrpAccount()
Compute AccountID from public key.
@ tecPATH_DRY
Definition TER.h:305
@ tecNO_AUTH
Definition TER.h:311
std::pair< TER, Strand > toStrand(ReadView const &sb, AccountID const &src, AccountID const &dst, Asset const &deliver, std::optional< Quality > const &limitQuality, std::optional< Asset > const &sendMaxAsset, STPath const &path, bool ownerPaysTransferFee, OfferCrossing offerCrossing, AMMContext &ammContext, std::optional< UInt256 > const &domainID, beast::Journal j)
Create a Strand for the specified path.
Definition PaySteps.cpp:170
@ tesSUCCESS
Definition TER.h:253
void testToStrand(FeatureBitset features)
void testNoAccount(FeatureBitset features)
static jtx::DirectStepInfo makeEndpointStep(jtx::Account const &src, jtx::Account const &dst, jtx::IOU const &iou)
static jtx::MPTEndpointStepInfo makeEndpointStep(jtx::Account const &src, jtx::Account const &dst, jtx::MPT const &mpt)
void testLoop(FeatureBitset features)
void testRIPD1373(FeatureBitset features)
void run() override
Runs the suite.