mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix last Liquidity Provider withdrawal:
Due to the rounding, LPTokenBalance of the last Liquidity Provider (LP), might not match this LP's trustline balance. This fix sets LPTokenBalance on last LP withdrawal to this LP's LPToken trustline balance.
This commit is contained in:
@@ -137,10 +137,15 @@ AMMTestBase::testAMM(
|
||||
else if (asset2.native())
|
||||
fund(env, gw, {alice, carol}, toFund2, {toFund1}, Fund::All);
|
||||
|
||||
AMM ammAlice(env, alice, asset1, asset2, false, tfee);
|
||||
BEAST_EXPECT(
|
||||
ammAlice.expectBalances(asset1, asset2, ammAlice.tokens()));
|
||||
cb(ammAlice, env);
|
||||
AMM ammAlice(
|
||||
env,
|
||||
alice,
|
||||
asset1,
|
||||
asset2,
|
||||
CreateArg{.log = false, .tfee = tfee, .err = ter});
|
||||
if (BEAST_EXPECT(
|
||||
ammAlice.expectBalances(asset1, asset2, ammAlice.tokens())))
|
||||
cb(ammAlice, env);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user