fix: correct token association check#1044
Conversation
Signed-off-by: Aubrey Du <duk110293@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the token association verification logic in the token airdrop example. The previous implementation incorrectly displayed token balances (which are always 0 after association) instead of properly checking whether tokens were associated with an account.
Key Changes:
- Refactored the token association verification to check for token presence in
token_balancesdictionary rather than displaying balance values - Updated the output format to clearly indicate whether tokens are "Associated" or "NOT Associated"
- Added a corresponding changelog entry documenting the fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
examples/tokens/token_airdrop_transaction.py |
Corrects the logic to check if tokens exist in the token_balances dictionary instead of displaying misleading zero balance values |
CHANGELOG.md |
Documents the fix for token association verification in the changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Aubrey Du <duk110293@gmail.com>
Signed-off-by: Aubrey Du <duk110293@gmail.com>
|
Request review if available @hiero-ledger/hiero-sdk-python-triage |
exploreriii
left a comment
There was a problem hiding this comment.
Hi @AubreyDDD
We just need to improve the association check, but actual balance checks can be desirable to help the user understand how the airdrop actually moves tokens around
|
Thanks a lot @AubreyDDD and for your suggestion! |
Signed-off-by: Aubrey Du <duk110293@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Description:
Corrects the token association verification logic in ·token_airdrop_transaction.py·. The previous implementation incorrectly displayed token balances (which are always 0 after association) instead of properly checking whether tokens were associated.
Related issue(s):
Fixes #815
Notes for reviewer:
Checklist