Skip to content

feat: Added TokenCancelAirdropTransaction #208

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

manishdait
Copy link
Contributor

Description:
Implemented the TokenCancelAirdropTransaction class to cancel one or more airdrops on network.

Changes:

  • Add PendingAirdropId and PendingAirdropRecord class to unique identifier a pending airdrop and store their data
  • Add unit test for PendingAirdropId and PendingAirdropRecord
  • Update TransactionRecord with new_pending_airdrops field to lists the pending airdrops that were created or updated during token_airdrop_tx
  • Updated unit test for TransactionRecord
  • Added TokenCancelAirdropTransaction class Implementation
  • Add integration/unit test for TokenCancelAirdropTransaction
  • Add cancel airdrop example
  • Update README.md in examples folder
  • Update __init__.py file with new class definition in __all__ list

Related issue(s):

Fixes #202

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait manishdait force-pushed the feat/cancel_airdrop branch from 2d4210a to ed96ae5 Compare July 22, 2025 09:39
self.pending_airdrop_id = pending_airdrop_id
self.amount = amount

def get_pending_airdrop_id(self) -> "PendingAirdropId":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bit of a Java-ism. In Python, it's more idiomatic to access public properties directly (eg record.pending_airdrop_id). so we could consider removing this to make the class feel more "conventionally pythonic"

super().__init__()
self.pending_airdrops: list[PendingAirdropId] = []
if (pending_airdrops is not None):
self.set_pending_airdrops(pending_airdrops)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.set_pending_airdrops(pending_airdrops)
self.pending_airdrops = pending_airdrops or []

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait manishdait force-pushed the feat/cancel_airdrop branch from 877c44b to ed521d4 Compare August 5, 2025 10:41
@exploreriii
Copy link
Contributor

Hello manish how is this progressing, is it ready for review?

@manishdait
Copy link
Contributor Author

Hello manish how is this progressing, is it ready for review?

I think it's ready for review.

@manishdait manishdait marked this pull request as ready for review August 9, 2025 16:08
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.

Add TokenCancelAirdropTransaction
3 participants