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:
Vito
2026-06-03 17:55:54 +02:00
parent 3daf40c408
commit 42b7e858a4

View File

@@ -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);