-
Notifications
You must be signed in to change notification settings - Fork 86
chore: refactor token examples #378
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
base: main
Are you sure you want to change the base?
chore: refactor token examples #378
Conversation
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
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.
Hi, this is going great! You've mostly achieved all that was requested, would you like to add a little more detail to the key steps make it easier to understand and perhaps add some checks if useful?
Signed-off-by: MontyPokemon <[email protected]>
Updated token creation and association logic to handle both NFT and fungible tokens. Added verification for token dissociation. Signed-off-by: MontyPokemon <[email protected]>
…mentation Updated freeze key generation method and enhanced freeze_token docstring for clarity. Signed-off-by: MontyPokemon <[email protected]>
Updated the supply key generation and added detailed comments for clarity. Signed-off-by: MontyPokemon <[email protected]>
Updated the supply key generation method and enhanced the documentation for the token minting function. Signed-off-by: MontyPokemon <[email protected]>
Updated the freeze key generation method and enhanced the token unfreeze function documentation. Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
|
@exploreriii I have done the requirements, if there is anything I should change please let me know |
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.
Thank you for all this
Could I ask you in the final functions to add a step by step?
e.g.
def token_associate...
"""
- Create an account that will associate tokens
- Create the tokens to associate to the account
- Associate the tokens to the account
- Verify the tokens are both associated to the account
It is not necessary but will help to improve the clarity for users
Also maybe some additional checks could be useful but not necessary, mentioned above
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Updated freeze_token function to include operator key and improved error handling for token transfer verification. Signed-off-by: MontyPokemon <[email protected]>
Refactor status code handling for account freeze. Signed-off-by: MontyPokemon <[email protected]>
Added token supply verification after minting. Signed-off-by: MontyPokemon <[email protected]>
…r minting Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
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.
Hi @MonaaEid . This is generally looking really great. I've taken a first pass through these recent changes - I need to look at it in more detail tomorrow or soon.
Meanwhile I've added a couple of ideas if you think they are worth pushing forward
|
please let me know when this is ready to review again |
|
Hello@exploreriii , I will. |
|
No problem, thanks for the update. Don't want to leave you hanging in case you were expecting a review. |
|
Hi @MonaaEid we have had a lot of PR's relating to examples but I have tried to keep the ones you are working on untouched. I think I created an issue on topic_create which conflits with yours, sorry. |
Signed-off-by: MontyPokemon <[email protected]>
Removed optional verification step after token dissociation. Signed-off-by: MontyPokemon <[email protected]>
Removed unfreeze function and added verification for token freeze. Signed-off-by: MontyPokemon <[email protected]>
Updated changelog with new features, changes, fixes, and breaking changes for version 0.1.6 and earlier. Signed-off-by: MontyPokemon <[email protected]>
Signed-off-by: MontyPokemon <[email protected]>
|
@exploreriii could you please review? |
|
Yes, thank you! If any other issue interest you in the meantime, please feel free to take it on while I finish reviewing this |
examples/token_mint_non_fungible.py
Outdated
| """Generate a new supply key for the token.""" | ||
| print("\nSTEP 1: Generating a new supply key...") | ||
| supply_key = PrivateKey.generate("ed25519") | ||
| supply_key = PrivateKey.generate_ed25519() |
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.
could be nice if we'd have generate() and then in there an env var either setting it to ED25519 or ECDSA
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.
Is this ok?
supply_key = PrivateKey.generate(os.getenv('HSDK_KEY_TYPE', 'ed25519'))
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.
yes, just maybe just KEY_TYPE. but else perfect:)
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.
would be great if we could implement this across the board
Signed-off-by: MontyPokemon <[email protected]>
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.
@MonaaEid thank you SO MUCH for this!
I see you added queries to verify, plus improved the existing scripts quite a bit
Please rebase then let's follow up with Nadine to see any final changes
|
I'm just noting the solo checks didn't run. Hopefully they re-trigger on rebasing |
Signed-off-by: MontyPokemon <[email protected]>
|
Need you to rebase, your changelog and examples/topic_create.py have conflicts. try then read merge_conflicts.md! |
|
I'm not familiar on the key generation issues, but did see other sdks start to recommend to not use ed25519 |
Signed-off-by: MontyPokemon <[email protected]> # Conflicts: # examples/token_mint_fungible.py
Signed-off-by: MontyPokemon <[email protected]> # Conflicts: # CHANGELOG.md
Signed-off-by: MontyPokemon <[email protected]>
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.
Sorry @MonaaEid you have two commits (near the start) that are not marked as verified, see the commits tab please.
You can pick at these commits and edit to sign them
else you can try to soft revert and re-sign
|
@MonaaEid : Hi there, are you still working on this issue? If so, do you require help with the signing of commits? Thanks |
Description:
This PR refactors the following example scripts to improve readability, modularity, and developer experience:
token_delete.py
token_dissociate.py
token_freeze.py
token_unfreeze.py
token_mint_fungible.py
token_mint_non_fungible.py
topic_create.py
Related issue(s):
Fixes #370
Checklist