Skip to content
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: add nft id validation to MsgSendNFT #1287

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

ulbqb
Copy link
Member

@ulbqb ulbqb commented Mar 18, 2024

Description

closes: #XXXX

This PR adds nft id validation to MsgSendNFT.

Motivation and context

The ValidateBasic() method of message MsgSendNFT is used to check the validity of the message during the stateless validation process. The current implementation of ValidateBasic() checks whether the provided IDs are valid TokenIDs with function ValidateTokenID():

It is insufficient as it allows Fungible tokens to pass through, potentially leading to unexpected errors since Fungible tokens are not intended to be processed by this function.

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@ulbqb ulbqb force-pushed the fix/sendnftmsg_validation branch from 10af857 to ecf227e Compare March 18, 2024 06:48
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.74%. Comparing base (47a5e9f) to head (5b47966).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1287   +/-   ##
=======================================
  Coverage   69.74%   69.74%           
=======================================
  Files         643      643           
  Lines       67261    67266    +5     
=======================================
+ Hits        46909    46917    +8     
+ Misses      18179    18177    -2     
+ Partials     2173     2172    -1     
Files Coverage Δ
x/collection/msgs.go 97.24% <100.00%> (+0.41%) ⬆️

@ulbqb ulbqb changed the title fix: add nft id validation of MsgSendNFT fix: add nft id validation to MsgSendNFT Mar 18, 2024
@ulbqb ulbqb force-pushed the fix/sendnftmsg_validation branch from 2349669 to 5b47966 Compare March 18, 2024 06:53
@ulbqb ulbqb marked this pull request as ready for review March 18, 2024 06:56
@ulbqb ulbqb self-assigned this Mar 18, 2024
@ulbqb ulbqb merged commit 5636259 into Finschia:main Mar 19, 2024
38 checks passed
@ulbqb ulbqb deleted the fix/sendnftmsg_validation branch March 19, 2024 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants