mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-19 13:10:46 +00:00
fix: Add amendment sponsor for AccountRootsDeletedClean (#7801)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user