Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Feb 2, 2023
1 parent dc4f146 commit 6211841
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 74 deletions.
4 changes: 1 addition & 3 deletions src/ripple/app/tx/impl/DeleteAccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,9 @@ DeleteAccount::preclaim(PreclaimContext const& ctx)
// authorized minter minted in a previous ledger.
if (ctx.view.rules().enabled(fixUnburnableNFToken) &&
((*sleAccount)[~sfFirstNFTokenSequence].value_or(0) +
(*sleAccount)[sfMintedNFTokens] + seqDelta >
(*sleAccount)[~sfMintedNFTokens].value_or(0) + seqDelta >
ctx.view.seq()))
{
return tecTOO_SOON;
}

// Verify that the account does not own any objects that would prevent
// the account from being deleted.
Expand Down
2 changes: 1 addition & 1 deletion src/test/app/NFTokenBurn_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ class NFTokenBurn_test : public beast::unit_test::suite
FeatureBitset const all{supported_amendments()};
FeatureBitset const fixNFTDir{fixNFTokenDirV1};

testWithFeats(all - fixNFTDir);
testWithFeats(all - fixNFTDir - fixUnburnableNFToken);
testWithFeats(all - fixUnburnableNFToken);
testWithFeats(all);
}
Expand Down
20 changes: 18 additions & 2 deletions src/test/app/NFTokenDir_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,16 @@ class NFTokenDir_test : public beast::unit_test::suite
Account const& account = accounts.emplace_back(
Account::base58Seed, std::string(seed));
env.fund(XRP(10000), account);
env.close();

// Should not advance ledger if fixUnburnableNFToken is
// enabled. Because otherwise, accounts are initialized at
// different ledgers, and will have different account
// sequences, which then cause the sequence number of
// NFTokenIDs to be different
if (!features[fixUnburnableNFToken])
env.close();
}
env.close();

// All of the accounts create one NFT and and offer that NFT to
// buyer.
Expand Down Expand Up @@ -408,8 +416,16 @@ class NFTokenDir_test : public beast::unit_test::suite
Account const& account = accounts.emplace_back(
Account::base58Seed, std::string(seed));
env.fund(XRP(10000), account);
env.close();

// Should not advance ledger if fixUnburnableNFToken is
// enabled. Because otherwise, accounts are initialized at
// different ledgers, and will have different account
// sequences, which then cause the sequence number of
// NFTokenIDs to be different
if (!features[fixUnburnableNFToken])
env.close();
}
env.close();

// All of the accounts create one NFT and and offer that NFT to
// buyer.
Expand Down
Loading

0 comments on commit 6211841

Please sign in to comment.