refactor(AMMClawback): move tfClawTwoAssets check (#5201)

Move tfClawTwoAssets check to preflight and return
error temINVALID_FLAG

---------

Co-authored-by: yinyiqian1 <yqian@ripple.com>
This commit is contained in:
Elliot Lee
2024-11-25 11:40:11 -08:00
parent f419c18056
commit b54d85d862
3 changed files with 15 additions and 14 deletions

View File

@@ -303,13 +303,13 @@ class AMMClawback_test : public jtx::AMMTest
// gw creates AMM pool of XRP/USD.
AMM amm(env, gw, XRP(100), USD(100), ter(tesSUCCESS));
// Return tecNO_PERMISSION because the issuer set tfClawTwoAssets,
// Return temINVALID_FLAG because the issuer set tfClawTwoAssets,
// but the issuer only issues USD in the pool. The issuer is not
// allowed to set tfClawTwoAssets flag if he did not issue both
// assts in the pool.
// assets in the pool.
env(amm::ammClawback(gw, alice, USD, XRP, std::nullopt),
txflags(tfClawTwoAssets),
ter(tecNO_PERMISSION));
ter(temINVALID_FLAG));
}
// Test clawing back XRP is being prohibited.