From 42b7e858a4f09cfeda5459997f75cea246939b5d Mon Sep 17 00:00:00 2001 From: Vito <5780819+Tapanito@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:55:54 +0200 Subject: [PATCH] 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. --- src/test/app/Vault_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index c7c75b26b2..78b571319e 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -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);