Skip to content

Commit

Permalink
[FOLD] Add tests for fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scottschurr authored and ximinez committed Nov 22, 2022
1 parent 0029087 commit fbfebd5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/app/NFToken_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,12 @@ class NFToken_test : public beast::unit_test::suite
//----------------------------------------------------------------------
// preclaim

// The buy offer must be non-zero.
env(token::acceptBuyOffer(buyer, beast::zero),
ter(tecOBJECT_NOT_FOUND));
env.close();
BEAST_EXPECT(ownerCount(env, buyer) == 0);

// The buy offer must be present in the ledger.
uint256 const missingOfferIndex = keylet::nftoffer(alice, 1).key;
env(token::acceptBuyOffer(buyer, missingOfferIndex),
Expand All @@ -1142,6 +1148,12 @@ class NFToken_test : public beast::unit_test::suite
env.close();
BEAST_EXPECT(ownerCount(env, buyer) == 0);

// The sell offer must be non-zero.
env(token::acceptSellOffer(buyer, beast::zero),
ter(tecOBJECT_NOT_FOUND));
env.close();
BEAST_EXPECT(ownerCount(env, buyer) == 0);

// The sell offer must be present in the ledger.
env(token::acceptSellOffer(buyer, missingOfferIndex),
ter(tecOBJECT_NOT_FOUND));
Expand Down

0 comments on commit fbfebd5

Please sign in to comment.