-
Notifications
You must be signed in to change notification settings - Fork 92
feat(examples): add pause key example for token create #833
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?
feat(examples): add pause key example for token create #833
Conversation
exploreriii
left a comment
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.
Great going!
I suspect there are some 'hidden errors' where it looks like it works because of the print statements, but misses some important errors
For example, I don't think we have a way to remove a pause key, currently, in which case, your prints will still 'succeed' even though it never failed.
for example try to use this
def remove_pause_key(client, token_id, pause_key):
print("🔹 Removing pause key while token is UNPAUSED...")
# Step 1: Update token to remove the pause key
tx = (
TokenUpdateTransaction()
.set_token_id(token_id)
.set_pause_key(None) # Correct way to remove the key
.freeze_with(client)
.sign(pause_key)
)
receipt = tx.execute(client)
if receipt.status != ResponseCode.SUCCESS:
print(f"❌ Failed to remove pause key: {ResponseCode(receipt.status).name}\n")
return False
print("✅ Pause key removed successfully, verifying...")
# Step 2: Query the token info to verify pause key is gone
info = TokenInfoQuery().set_token_id(token_id).execute(client)
if info.pause_key is None:
print("✅ Verification passed: Pause key is now None.\n")
return True
else:
print(f"❌ Verification failed: Pause key still exists: {info.pause_key}\n")
return False
Verification failed: Pause key still exists:
Please take a look at the script, perhaps add more checks (or expand the unit or integration tests) to verify your theories
I don't think we can delete a key like this, so if we are missing a method in the transaction, please add that -- but i don't know/otherwise delete bonus section
Thanks
|
Hi @undefinedIsMyLife please rebase and see feedback above when you can |
|
I will do finish the issue by tonight or tomorrow is that fine? due to some urgent emergency i wasn't able to resolve the last issue |
|
sorry to hear that, take the time you need |
|
Removed the bonus section since the SDK currently does not support removing a pause key, and the behavior cannot be demonstrated reliably. Updated the example to reflect only supported pause/unpause operations. Please review when you have time. |
exploreriii
left a comment
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 @undefinedIsMyLife
Looking great! Just tidy up some of the error catching please so your print statements are as truthful as possible!
|
Hi, this is WorkflowBot.
|
|
Hi @undefinedIsMyLife please rebase this to pull in the recent changes from main |
|
request review if availalbe @tech0priyanshu |
877ca52 to
cd07a78
Compare
exploreriii
left a comment
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.
This is great! Would be really happy to merge this
We released a new version 0.1.9 so please update your changelog as described
Please also move the example to /tokens
Thank you!
exploreriii
left a comment
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 @undefinedIsMyLife this is approved!
But we cannot merge - please resolve the changelog conflict
that will mean pulling new data from upstream then rebasing
docs/sdk_developers/rebasing.md
ensure your upstream is set.
you'll then have a merge conflict:
docs/sdk_developers/merge_conflicts.md
This will be accepting both in this case, i think.
Thanks!
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
95959fd to
58f6188
Compare
…ro-ledger#833) Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
|
Sorry @undefinedIsMyLife we may have a bug, will get started on it #921 |
|
Thanks for the update! I've restored the changelog entry exactly as requested. Thanks again! |
Signed-off-by: undefinedIsMyLife <shinetina169@gmail.com>
|
@undefinedIsMyLife Please add a changelog entry the file is currently missing. |
|
I appreciate your patience, we need to wait for the fix #924 |
|
Hi @undefinedIsMyLife sincere apologies for the disruption and delays |
Description:
Add an example demonstrating how token pause keys work in the Hiero Python SDK.
examples/token_create_transaction_pause_key.pyshowing:Related issue(s):
Fixes #820
Notes for reviewer:
This example follows the same structure as existing examples and includes detailed comments explaining pause key behavior.
Checklist