-
Notifications
You must be signed in to change notification settings - Fork 76
fix: nftData unique bug #1550
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
fix: nftData unique bug #1550
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1550 +/- ##
===========================================
+ Coverage 68.74% 68.79% +0.05%
===========================================
Files 239 239
Lines 9672 9676 +4
Branches 5369 5371 +2
===========================================
+ Hits 6649 6657 +8
+ Misses 1629 1622 -7
- Partials 1394 1397 +3 ☔ View full report in Codecov by Sentry. |
IMO it should not matter. A NFT that was minted and burned in the ledger could be regarded as "non-existent".
How would it be incorrect? the data from the burn will have the correct owner and isBurn. (I haven't looked at the code yet) |
As the test code shows, https://godbolt.org/z/jP384P7rb, the sorted result is not what we expected.
Again, the sorted result is not expected. So the nftDatas from burn tx might get removed. I agreed the token minted and burned in the same ledger should be considered as "non-existent", however, current implementation will save the data into the DB , right? Maybe this is another bug we shall fix. |
kuznetsss
left a comment
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.
Looks good, just a few nits, but feel free to ignore.
godexsoft
left a comment
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.
Few small things on top of what others already noticed 👍
kuznetsss
left a comment
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.
👍
shawnxie999
left a comment
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.
Looks good. Thanks for fixing this! 🙇
bbd2470 to
cb386f1
Compare
Similar with this one. #1542
It failed to unique the NFT data as we wish. https://godbolt.org/z/jP384P7rb
It will write incorrect data if
1 mint and burn happen in the same ledger , wrong data write to nf_tokens and uri tables.
2 accept nft offer and burn happen in the same ledger, the isburn maybe incorrect.
I am separating the function to NFTHelper to unittest it.