more codecov (hopefully)

This commit is contained in:
Mayukha Vadari
2026-05-27 17:25:41 -04:00
parent ff0ddad2bb
commit 7e82565162
3 changed files with 28 additions and 0 deletions

View File

@@ -1101,6 +1101,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::Suite
if (features[fixCleanup3_1_3])
{
buyerCount--;
BEAST_EXPECT(!env.closed()->exists(keylet::nftoffer(buyerExpOfferIndex)));
}
BEAST_EXPECT(ownerCount(env, buyer) == buyerCount);
@@ -1124,6 +1125,7 @@ class NFTokenBaseUtil_test : public beast::unit_test::Suite
if (features[fixCleanup3_1_3])
{
aliceCount--;
BEAST_EXPECT(!env.closed()->exists(keylet::nftoffer(aliceExpOfferIndex)));
}
BEAST_EXPECT(ownerCount(env, alice) == aliceCount);
BEAST_EXPECT(ownerCount(env, buyer) == buyerCount);

View File

@@ -798,11 +798,13 @@ public:
// The offer expires (it's not removed yet).
env.close();
env.require(Owners(bob, 1), offers(bob, 1));
auto const expiredBobOffer = keylet::offer(bob, env.seq(bob) - 1);
// bob creates the offer that will be crossed.
env(offer(bob, usd(500), XRP(500)), Ter(tesSUCCESS));
env.close();
env.require(Owners(bob, 2), offers(bob, 2));
auto const crossedBobOffer = keylet::offer(bob, env.seq(bob) - 1);
env(trust(alice, usd(1000)), Ter(tesSUCCESS));
env(pay(gw, alice, usd(1000)), Ter(tesSUCCESS));
@@ -821,6 +823,8 @@ public:
Balance(bob, usd(kNone)),
Owners(bob, 1),
offers(bob, 1));
BEAST_EXPECT(!env.closed()->exists(expiredBobOffer));
BEAST_EXPECT(env.closed()->exists(crossedBobOffer));
// Order that can be filled
env(offer(alice, XRP(500), usd(500)), Txflags(tfFillOrKill), Ter(tesSUCCESS));

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