fix: Add amendment sponsor for AccountRootsDeletedClean (#7801)

This commit is contained in:
Kassaking7
2026-07-14 15:41:53 -04:00
committed by GitHub
parent 530e09dbe8
commit cda63d00a2
2 changed files with 18 additions and 1 deletions

View File

@@ -489,7 +489,7 @@ AccountRootsDeletedClean::finalize(
// feature is enabled. Enabled, or not, though, a fatal-level message will
// be logged
[[maybe_unused]] bool const enforce = view.rules().enabled(fixCleanup3_2_0) ||
view.rules().enabled(featureSingleAssetVault) ||
view.rules().enabled(featureSponsor) || view.rules().enabled(featureSingleAssetVault) ||
view.rules().enabled(featureLendingProtocol);
auto const objectExists = [&view, enforce, &j](auto const& keylet) {

View File

@@ -412,6 +412,23 @@ class Invariants_test : public beast::unit_test::Suite
XRPAmount{},
STTx{ttACCOUNT_DELETE, [](STObject& tx) {}});
doInvariantCheck(
Env{*this, FeatureBitset{featureSponsor}},
{{"account deletion left behind a sponsorship field"}},
[&](Account const& a1, Account const& a2, ApplyContext& ac) {
auto const sleA1 = ac.view().peek(keylet::account(a1.id()));
if (!sleA1)
return false;
sleA1->at(sfBalance) = beast::kZero;
sleA1->setAccountID(sfSponsor, a2.id());
ac.view().erase(sleA1);
return true;
},
XRPAmount{},
STTx{ttACCOUNT_DELETE, [](STObject& tx) {}});
for (auto const& keyletInfo : kDirectAccountKeylets)
{
// TODO: Use structured binding once LLVM 16 is the minimum