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

Added NftId class, fixed some bugs #37

Closed
wants to merge 5 commits into from

Conversation

LukeBair
Copy link
Contributor

@LukeBair LukeBair commented Jan 30, 2025

Added NftId Class

Added a nft_id.py file that contains a NftId class, the NftId class has the following variables and functions:

  • tokenId and serialNumber
  • init()
  • is_valid(), checks to see if the NftId is in a valid format
  • from_proto()
  • to_proto()
  • from_string()
  • str()
  • repr()
  • eq()
    The NftId class has the "@dataclass" annotation, and autogenerates the repr(), init(), and eq() functions, it also freezes variables to make them immutable.

Modified TokenId Class

Added a few functions and type safety to the TokenId class (in token_id.py), functions added:

  • is_valid(), checks to see if the TokenId is in a valid format
  • repr()
  • eq()
  • hash(), there was an error that required TokenId to be hashable
    The TokenId class now has the "@dataclass" annotation, and autogenerates the repr(), init(), and eq() functions, it also freezes variables to make them immutable.

Misc

Added nft_id_test() which checks to make sure that incorrect values are found and correct exceptions raised when they should.

Fixed a bug in test_token_dissociate_transaction.py which was causing pytest to fail due to an invalid path.

@LukeBair LukeBair marked this pull request as draft January 30, 2025 04:14
@LukeBair LukeBair marked this pull request as ready for review January 30, 2025 16:56
@LukeBair LukeBair closed this Feb 4, 2025
LukeBair and others added 5 commits February 4, 2025 15:43
…tors

Modified parts of the TokenId python class to add type safety, added __repr__ and __eq__  methods to the TokenId class.

Signed-off-by: LukeBair <[email protected]>
Signed-off-by: LukeBair <[email protected]>
Signed-off-by: LukeBair <[email protected]>
…tors

Modified parts of the TokenId python class to add type safety, added __repr__ and __eq__  methods to the TokenId class.

Signed-off-by: LukeBair <[email protected]>
@LukeBair LukeBair reopened this Feb 5, 2025
@LukeBair LukeBair closed this Feb 5, 2025
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.

2 participants