feat: Add CancelAirdrop to TCK - #2555
Conversation
Signed-off-by: aceppaluni <aceppaluni@gmail.com>
WalkthroughThe TCK adds the ChangesCancel airdrop
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🟡 Moderate · up to The PR adds cancelAirdrop support, but malformed pendingAirdrops values can bypass controlled validation and raise AttributeError instead of producing a controlled parameter error. The current head should not merge until this bounded request-handling risk is corrected or explicitly accepted; the test naming and assertion-message follow-ups are minor. Sequence Diagram(s)sequenceDiagram
participant TCKClient
participant cancelAirdrop
participant TokenCancelAirdropTransaction
participant HederaNetwork
TCKClient->>cancelAirdrop: CancelAirdropParams
cancelAirdrop->>TokenCancelAirdropTransaction: Add pending airdrop IDs
cancelAirdrop->>HederaNetwork: Execute transaction
HederaNetwork-->>cancelAirdrop: Return receipt status
cancelAirdrop-->>TCKClient: CancelAirdropResponse
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 342c74c4-058b-4e34-ac43-d548be0f2a00
📒 Files selected for processing (3)
tck/handlers/token.pytck/param/token.pytck/response/token.py
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.
| Requesting triage review from: @hiero-ledger/hiero-sdk-python-triage |
Signed-off-by: aceppaluni <aceppaluni@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 02abfdb8-319b-4ff6-9618-d279b877eea7
📒 Files selected for processing (2)
tck/handlers/token.pytck/param/token.py
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
Signed-off-by: aceppaluni <aceppaluni@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #2555 +/- ##
==========================================
- Coverage 95.44% 95.44% -0.01%
==========================================
Files 165 165
Lines 10565 10563 -2
==========================================
- Hits 10084 10082 -2
Misses 481 481 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3d4e1774-2c58-42bd-a634-9e81681fc5a5
📒 Files selected for processing (3)
src/hiero_sdk_python/tokens/token_airdrop_transaction_cancel.pytck/handlers/token.pytests/unit/token_airdrop_transaction_cancel_test.py
💤 Files with no reviewable changes (2)
- src/hiero_sdk_python/tokens/token_airdrop_transaction_cancel.py
- tck/handlers/token.py
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
|
@aceppaluni please update the branch |
|
👋 Hi @aceppaluni! Great work completing a Beginner issue! 🎉 Thanks for your contribution! 🚀 Here are some issues you might want to explore next: 🌟 Stay connected: Happy coding! 🚀 |
Description:
Adds the
cancelAirdropJSON-RPC TCK method by mirroring the existingclaimTokenhandler pattern.The implementation is contained entirely within the token TCK modules. No changes are required to the generic dispatch, registration, protocol, or server machinery.
Changes
Added
CancelAirdropParamsintck/param/token.pyBaseTransactionParamssenderAccountId,receiverAccountId,tokenId, and optionalserialNumbersserialNumbersas a list of stringsAdded
CancelAirdropResponseintck/response/token.pyStatusOnlyResponsesubclass matchingClaimTokenResponseAdded
cancelAirdropsupport intck/handlers/token.pyTokenCancelAirdropTransactionPendingAirdropIdper NFT serial whenserialNumbersis providedadd_pending_airdrop(...)APIclaimTokenCancelAirdropResponseOptionally adds unit coverage for fungible and NFT pending airdrop construction and verifies the
cancelAirdropRPC method registration.Scope
No changes are made to:
tck/handlers/__init__.pytck/handlers/registry.pytck/protocol.pytck/server.pyRelated issue(s):
Fixes #2423
Notes for reviewer:
Checklist