fix: NFTs were not being properly processed#219
Merged
andreabadesso merged 10 commits intomasterfrom Mar 18, 2025
Merged
Conversation
38c3483 to
440ca83
Compare
pedroferreira1
previously approved these changes
Mar 11, 2025
pedroferreira1
approved these changes
Mar 11, 2025
pedroferreira1
previously approved these changes
Mar 11, 2025
tuliomir
previously approved these changes
Mar 17, 2025
|
|
||
| // Test that this transaction is detected as an NFT | ||
| expect(isNftTransactionSpy).toHaveBeenCalledTimes(0); | ||
| const shouldInvoke = NftUtils.shouldInvokeNftHandlerForTx(txFromEvent, mockNetwork as any, logger); |
Contributor
There was a problem hiding this comment.
suggestion(non-blocking): Avoid using any, as it's prohibited by many standard typescript linting rules.
Suggested change
| const shouldInvoke = NftUtils.shouldInvokeNftHandlerForTx(txFromEvent, mockNetwork as any, logger); | |
| const shouldInvoke = NftUtils.shouldInvokeNftHandlerForTx(txFromEvent, mockNetwork as unknown as Network, logger); |
Collaborator
Author
There was a problem hiding this comment.
Done, thanks!
006b64a
tuliomir
approved these changes
Mar 17, 2025
pedroferreira1
approved these changes
Mar 18, 2025
r4mmer
added a commit
that referenced
this pull request
Mar 18, 2025
…-lib-v1.14.1 * origin/master: fix: NFTs were not being properly processed (#219)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
There was a bug in the NFT handler invocation logic. The
shouldInvokeNftHandlerForTxmethod was failing for valid NFT transactions because the event data from the full node contained null values in the decoded field for some outputs. When the output data wasn't properly transformed to handle these null values (replacing them with empty objects {}), the NFT detection would fail silently, causing NFTs to not be properly processed.Acceptance Criteria
Checklist
[X] If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
[X] Make sure either the unit tests and/or the QA tests are capable of testing the new features
[X] Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.