-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixNFTokenReserve
: Throw error when NFT buyer does not meet reserve requirement
#4767
Conversation
60db95e
to
68f354d
Compare
fixNFTokenReserve
: Throw error when NFT buyer does not meet reserve requirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't let the comments I left discourage you. This is a great pull request. The fix looks good. I think you did an especially good job with the tests.
I did leave some comments for you to consider, but they are mostly about different ways to structure the same code. Feel free to push back on any of them.
Nice job!
@scottschurr thanks for the great suggestions! this PR is now ready for re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your work @shawnxie999 , this looks nice
Intend to merge this after 2.0.1 is released |
@shawnxie999 Thank you for fixing the issue. |
Some unit tests were renamed. @shawnxie999 to resolve conflicts (no hurry). |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #4767 +/- ##
===========================================
- Coverage 61.50% 61.50% -0.01%
===========================================
Files 797 797
Lines 70122 70130 +8
Branches 36238 36244 +6
===========================================
+ Hits 43128 43130 +2
- Misses 19755 19758 +3
- Partials 7239 7242 +3 ☔ View full report in Codecov by Sentry. |
@shawnxie999 could you have a look at the "6 lines in your changes are missing coverage" reported above? |
@intelliot these are the lines that return tecInternal errors, which are guarded by the preclaim checks already. I dont think we need additional tests needed for these lines 👍 |
|
…LF#4767) Without this amendment, an NFTokenAcceptOffer transaction can succeed even when the NFToken recipient does not have sufficient reserves for the new NFTokenPage. This allowed accounts to accept NFT sell offers without having a sufficient reserve. (However, there was no issue in brokered mode or when a buy offer is involved.) Instead, the transaction should fail with `tecINSUFFICIENT_RESERVE` as appropriate. The `fixNFTokenReserve` amendment adds checks in the NFTokenAcceptOffer transactor to check if the OwnerCount changed. If it did, then it checks the new reserve requirement. Fix XRPLF#4679
High Level Overview of Change
Add checks in the NFTokenAcceptOffer transactor to check if OwnerCount changed, if it did, then check for the reserve requirement.
Context of Change
Fixes a problem where someone could accept an NFT sell offer without needing reserve.
This problem, however, does not occur when buy offer is involved or in brokered mode.
Type of Change