feat: Add MPT support to DEX (#5285)

This commit is contained in:
Gregory Tsipenyuk
2026-04-08 12:17:37 -04:00
committed by GitHub
parent 6d1a5be8d2
commit dfcad69155
223 changed files with 34897 additions and 4228 deletions

View File

@@ -1348,7 +1348,7 @@ private:
Env env = pathTestEnv();
env.fund(XRP(100'000'250), alice);
fund(env, gw, {carol, bob}, {USD(100)}, Fund::All);
fund(env, gw, {alice}, {USD(100)}, Fund::IOUOnly);
fund(env, gw, {alice}, {USD(100)}, Fund::TokenOnly);
AMM const ammCarol(env, carol, XRP(100), USD(100));
STPathSet st;
@@ -1363,7 +1363,7 @@ private:
BEAST_EXPECT(sa == XRP(100'000'000));
// Bob gets ~99.99USD. This is the amount Bob
// can get out of AMM for 100,000,000XRP.
BEAST_EXPECT(equal(da, STAmount{bob["USD"].issue(), UINT64_C(99'9999000001), -10}));
BEAST_EXPECT(equal(da, STAmount{bob["USD"], UINT64_C(99'9999000001), -10}));
}
// carol holds gateway AUD, sells gateway AUD for XRP
@@ -1941,10 +1941,10 @@ private:
};
{
// BTC -> USD
STPath const p1({IPE(USD.issue())});
STPath const p1({IPE(USD)});
paths.push_back(p1);
// BTC -> EUR -> USD
STPath const p2({IPE(EUR.issue()), IPE(USD.issue())});
STPath const p2({IPE(EUR), IPE(USD)});
paths.push_back(p2);
}
@@ -3324,8 +3324,7 @@ private:
env.trust(USD(1'000), alice, bob);
env.trust(EUR(1'000), alice, bob);
env.close();
fund(env, bob, {alice, gw}, {BobUSD(100), BobEUR(100)}, Fund::IOUOnly);
env.close();
fund(env, bob, {alice, gw}, {BobUSD(100), BobEUR(100)}, Fund::TokenOnly);
AMM const ammBobXRP_USD(env, bob, XRP(100), BobUSD(100));
env(offer(gw, XRP(100), USD(100)), txflags(tfPassive));