mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 09:46:53 +00:00
test: Restore clawback-under-MPT-global-lock coverage
The previous edit dropped the assertion that clawback still works when the MPT asset is globally locked. Restore it before the issuer-redemption step, claw back 50 of the 100 deposited units, then withdraw the remaining 50 to the issuer so both behaviours are exercised in the same test.
This commit is contained in:
@@ -1701,14 +1701,21 @@ class Vault_test : public beast::unit_test::Suite
|
||||
tx = vault.withdraw({.depositor = depositor, .id = keylet.key, .amount = asset(100)});
|
||||
env(tx, Ter(tecLOCKED));
|
||||
|
||||
// Clawback is still permitted, even with global lock.
|
||||
tx = vault.clawback(
|
||||
{.issuer = issuer, .id = keylet.key, .holder = depositor, .amount = asset(50)});
|
||||
env(tx);
|
||||
env.close();
|
||||
|
||||
// Redemption to the issuer bypasses freeze checks end-to-end:
|
||||
// preclaim's issuer guard skips all three checks, and doApply uses
|
||||
// FreezeHandling::IgnoreFreeze for the accountHolds balance check.
|
||||
tx = vault.withdraw({.depositor = depositor, .id = keylet.key, .amount = asset(50)});
|
||||
tx[sfDestination] = issuer.human();
|
||||
env(tx);
|
||||
env.close();
|
||||
|
||||
// Withdrawal burned all depositor shares — MPToken is removed.
|
||||
// Withdrawal burned remaining depositor shares — MPToken is removed.
|
||||
auto const mptSle = env.le(keylet::mptoken(share, depositor.id()));
|
||||
BEAST_EXPECT(mptSle == nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user