Skip to content

Commit

Permalink
remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
yinyiqian1 committed Sep 19, 2024
1 parent 7a4429e commit 384a73c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/test/app/AMMClawback_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,9 @@ class AMMClawback_test : public jtx::AMMTest
void
testNotHoldingLptoken(FeatureBitset features)
{
testcase("test AMMClawback from account which does not own any lptoken in the pool");
testcase(
"test AMMClawback from account which does not own any lptoken in "
"the pool");
using namespace jtx;

Env env(*this, features);
Expand Down
15 changes: 10 additions & 5 deletions src/xrpld/app/tx/detail/AMMWithdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ AMMWithdraw::applyGuts(Sandbox& sb)
{
TER result;
STAmount newLPTokenBalance;
bool withdrawAll = ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
bool withdrawAll =
ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
std::tie(result, newLPTokenBalance, std::ignore, std::ignore) =
equalWithdrawTokens(
sb,
Expand Down Expand Up @@ -570,7 +571,8 @@ AMMWithdraw::equalWithdrawLimit(
STAmount newLPTokenBalance;
auto frac = Number{amount} / amountBalance;
auto const amount2Withdraw = amount2Balance * frac;
bool withdrawAll = ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
bool withdrawAll =
ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
if (amount2Withdraw <= amount2)
{
std::tie(result, newLPTokenBalance, std::ignore, std::ignore) =
Expand Down Expand Up @@ -632,7 +634,8 @@ AMMWithdraw::singleWithdraw(

TER result;
STAmount newLPTokenBalance;
bool withdrawAll = ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
bool withdrawAll =
ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
std::tie(result, newLPTokenBalance, std::ignore, std::ignore) = withdraw(
view,
ammAccount,
Expand Down Expand Up @@ -678,7 +681,8 @@ AMMWithdraw::singleWithdrawTokens(
{
TER result;
STAmount newLPTokenBalance;
bool withdrawAll = ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
bool withdrawAll =
ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
std::tie(result, newLPTokenBalance, std::ignore, std::ignore) =
withdraw(
view,
Expand Down Expand Up @@ -752,7 +756,8 @@ AMMWithdraw::singleWithdrawEPrice(
{
TER result;
STAmount newLPTokenBalance;
bool withdrawAll = ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
bool withdrawAll =
ctx_.tx[sfFlags] & (tfWithdrawAll | tfOneAssetWithdrawAll);
std::tie(result, newLPTokenBalance, std::ignore, std::ignore) =
withdraw(
view,
Expand Down
3 changes: 1 addition & 2 deletions src/xrpld/app/tx/detail/InvariantCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ using InvariantChecks = std::tuple<
ValidNewAccountRoot,
ValidNFTokenPage,
NFTokenCountTracking,
ValidClawback,
ValidAMMClawback>;
ValidClawback>;

/**
* @brief get a tuple of all invariant checks
Expand Down

0 comments on commit 384a73c

Please sign in to comment.