refactor: Clean up tec object deletion logic (#6588)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Mayukha Vadari
2026-06-22 14:44:42 -04:00
committed by GitHub
parent 19a9ed7767
commit dd7401fde2
5 changed files with 172 additions and 122 deletions

View File

@@ -72,6 +72,27 @@ public:
env(regkey(alice, alice), Ter(temBAD_REGKEY));
}
void
testNoAlternativeKey()
{
using namespace test::jtx;
testcase("Cannot remove last signing method");
Env env{*this, testableAmendments()};
Account const alice("alice");
Account const bob("bob");
env.fund(XRP(10000), alice);
env(regkey(alice, bob));
env(fset(alice, asfDisableMaster), Sig(alice));
env(regkey(alice, kDisabled), Sig(bob), Ter(tecNO_ALTERNATIVE_KEY));
auto const sle = env.le(alice);
BEAST_EXPECT(
sle && sle->isFlag(lsfDisableMaster) && sle->getAccountID(sfRegularKey) == bob.id());
}
void
testPasswordSpent()
{
@@ -169,6 +190,7 @@ public:
{
testDisabledMasterKey();
testDisabledRegularKey();
testNoAlternativeKey();
testPasswordSpent();
testUniversalMask();
testTicketRegularKey();