Skip to content

Commit

Permalink
fix duplicate error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tequdev committed Feb 1, 2024
1 parent 329729c commit 95b2e08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/ripple/app/tx/impl/NFTokenMint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ NFTokenMint::preclaim(PreclaimContext const& ctx)
{
auto const nftIssuer =
ctx.tx[~sfIssuer].value_or(ctx.tx[sfAccount]);
if (!ctx.view.exists(keylet::account(nftIssuer)))
return tecNO_ISSUER;

if (!ctx.view.exists(keylet::line(nftIssuer, amount->issue())))
return tecNO_LINE;
Expand Down
11 changes: 6 additions & 5 deletions src/test/app/NFToken_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3175,19 +3175,20 @@ class NFTokenBaseUtil_test : public beast::unit_test::suite
// minter mint and offer to buyer
if (features[featureNFTokenMintOffer])
{
// enable flag
env(fset(buyer, asfDisallowIncomingNFTokenOffer));
// a sell offer from the minter to the buyer should be rejected
env(token::mint(minter),
token::amount(drops(1)),
token::destination(buyer),
ter(tecNO_PERMISSION));
env.close();
}
else
{

// disable flag
env(fclear(buyer, asfDisallowIncomingNFTokenOffer));
env(token::mint(minter),
token::amount(drops(1)),
token::destination(buyer),
ter(temDISABLED));
token::destination(buyer));
env.close();
}
}
Expand Down

0 comments on commit 95b2e08

Please sign in to comment.