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 python class, and fixed some bugs #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LukeBair
Copy link

@LukeBair LukeBair commented Feb 5, 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.

…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 <74842241+LukeBair@users.noreply.github.com>
@rbair23 rbair23 self-requested a review February 5, 2025 21:44
@ryjones ryjones requested review from a team February 11, 2025 11:02
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