Skip to content

feat: implemented wipeToken TCK endpt.#2414

Merged
exploreriii merged 9 commits into
hiero-ledger:mainfrom
Adityarya11:feat/tck-wipeToken#2398
Jul 20, 2026
Merged

feat: implemented wipeToken TCK endpt.#2414
exploreriii merged 9 commits into
hiero-ledger:mainfrom
Adityarya11:feat/tck-wipeToken#2398

Conversation

@Adityarya11

Copy link
Copy Markdown
Contributor

Description:
This PR introduce the wipeToken method to tck module.

Changes Made:

Related issue(s):

Fixes #2398

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.) (No Need)
  • Ruff formatted.

@github-actions github-actions Bot added approved Issue has been approved by team member scope: TCK involves engineering for the implementation of TCK method and module skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples labels Jul 10, 2026
@Adityarya11
Adityarya11 marked this pull request as ready for review July 10, 2026 13:48
@Adityarya11
Adityarya11 requested a review from a team as a code owner July 10, 2026 13:48
@Adityarya11
Adityarya11 marked this pull request as draft July 10, 2026 13:49
@Adityarya11 Adityarya11 self-assigned this Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds TCK support for the wipeToken JSON-RPC endpoint, aligning the Python SDK’s TCK module with the TokenWipeTransaction specification.

Changes:

  • Added WipeTokenParams request model and JSON param parsing for the new endpoint.
  • Added WipeTokenResponse response model.
  • Implemented the wipeToken RPC handler and transaction builder using TokenWipeTransaction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tck/response/token.py Adds a status-only response dataclass for wipeToken.
tck/param/token.py Adds request params dataclass + JSON parsing for wipeToken.
tck/handlers/token.py Adds wipeToken RPC method and constructs/executes TokenWipeTransaction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tck/handlers/token.py Outdated
Comment thread tck/handlers/token.py Outdated
Comment thread tck/handlers/token.py Outdated
Comment thread tck/handlers/token.py Outdated
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Adityarya11, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0be4ce32-f99c-4632-ae84-3dfa681d2999

📥 Commits

Reviewing files that changed from the base of the PR and between 96165da and edd4b5c.

📒 Files selected for processing (3)
  • tck/handlers/token.py
  • tck/param/token.py
  • tck/response/token.py

Walkthrough

Adds the wipeToken RPC endpoint to the TCK module, including parameter parsing, response modeling, transaction construction, execution, receipt retrieval, and status mapping.

Changes

wipeToken endpoint

Layer / File(s) Summary
Request and response contracts
tck/param/token.py, tck/response/token.py
Adds WipeTokenParams with serial-number list validation and shared transaction fields, plus WipeTokenResponse.
Transaction construction and RPC execution
tck/handlers/token.py
Adds the wipeToken RPC handler, builds and executes TokenWipeTransaction, retrieves the receipt, and returns the mapped status.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant JSONRPCClient
  participant wipe_token
  participant TokenWipeTransaction
  participant TransactionReceipt
  JSONRPCClient->>wipe_token: WipeTokenParams
  wipe_token->>TokenWipeTransaction: build transaction
  wipe_token->>TokenWipeTransaction: execute
  wipe_token->>TransactionReceipt: get_receipt(validate_status=True)
  TransactionReceipt-->>wipe_token: receipt.status
  wipe_token-->>JSONRPCClient: WipeTokenResponse
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding the wipeToken TCK endpoint.
Description check ✅ Passed The description matches the changeset and references the wipeToken addition and spec source.
Linked Issues check ✅ Passed The PR adds the handler and the new params/response dataclasses required by issue #2398.
Out of Scope Changes check ✅ Passed The changes are tightly scoped to the wipeToken endpoint with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2398

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3201578c-9494-407f-b06a-7558c2cbc0b2

📥 Commits

Reviewing files that changed from the base of the PR and between deb64f3 and 4be1827.

📒 Files selected for processing (3)
  • tck/handlers/token.py
  • tck/param/token.py
  • tck/response/token.py

Comment thread tck/handlers/token.py
Comment thread tck/handlers/token.py Outdated
Comment thread tck/handlers/token.py Outdated
Comment thread tck/param/token.py
@manishdait

Copy link
Copy Markdown
Contributor

Hi @Adityarya11, Please update the branch and resolve the conflicts

@github-actions

Copy link
Copy Markdown

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@Adityarya11
Adityarya11 force-pushed the feat/tck-wipeToken#2398 branch 2 times, most recently from 48c58d9 to ca54f12 Compare July 13, 2026 23:55
@Adityarya11
Adityarya11 requested a review from manishdait July 14, 2026 07:14
Comment thread tests/tck/token_params_test.py Outdated
Comment thread tck/param/token.py Outdated
Comment thread tck/param/token.py Outdated
Comment thread tck/param/token.py Outdated
Comment thread tck/handlers/token.py Outdated
Comment thread tck/handlers/token.py
@aceppaluni aceppaluni removed the approved Issue has been approved by team member label Jul 14, 2026
@Adityarya11
Adityarya11 force-pushed the feat/tck-wipeToken#2398 branch from 562ff11 to 93edf95 Compare July 15, 2026 05:20
@Adityarya11
Adityarya11 requested a review from manishdait July 15, 2026 05:21
@github-actions github-actions Bot added the approved Issue has been approved by team member label Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (92.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2414      +/-   ##
==========================================
- Coverage   94.99%   94.98%   -0.01%     
==========================================
  Files         164      164              
  Lines       10449    10452       +3     
==========================================
+ Hits         9926     9928       +2     
- Misses        523      524       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tck/param/token.py Outdated
Comment thread tck/param/token.py Outdated
Comment thread tck/param/token.py Outdated
Comment thread tck/param/token.py Outdated
@github-actions

Copy link
Copy Markdown

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours will begin in approximately 3 hours and 28 minutes (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here for any changes.

From,
The Python SDK Team

@Adityarya11
Adityarya11 force-pushed the feat/tck-wipeToken#2398 branch 2 times, most recently from 28bbd62 to 4b31404 Compare July 15, 2026 14:31
@exploreriii
exploreriii marked this pull request as draft July 18, 2026 10:22
@Adityarya11
Adityarya11 force-pushed the feat/tck-wipeToken#2398 branch from ac27520 to 9df96d2 Compare July 18, 2026 17:45
@Adityarya11
Adityarya11 requested a review from exploreriii July 20, 2026 00:53
@manishdait

Copy link
Copy Markdown
Contributor

is this ready to review again

@Adityarya11
Adityarya11 marked this pull request as ready for review July 20, 2026 09:39
@Adityarya11

Copy link
Copy Markdown
Contributor Author

is this ready to review again

Yeah sure

@manishdait manishdait left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just small change rest looks good to me.

Comment thread tck/handlers/token.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
tck/handlers/token.py (1)

795-796: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use int() instead of to_int() to properly surface validation errors.

The to_int helper suppresses ValueError and returns None for invalid numeric strings. If a user provides an invalid amount string, to_int silently returns None, resulting in set_amount(None) being called instead of failing the request with a clear validation error. This also violates the set_amount method signature, which expects an int.

Use int() directly so that invalid strings properly raise an exception.

🐛 Proposed fix
     if params.amount is not None:
-        transaction.set_amount(to_int(params.amount))
+        transaction.set_amount(int(params.amount))

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1371e1d4-2604-4704-83b0-021c231a171a

📥 Commits

Reviewing files that changed from the base of the PR and between 27ee2bc and 96165da.

📒 Files selected for processing (3)
  • tck/handlers/token.py
  • tck/param/token.py
  • tck/response/token.py

Comment thread tck/handlers/token.py Outdated
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Adityarya11 <arya050411@gmail.com>
Signed-off-by: Aditya Arya <arya050411@gmail.com>
Signed-off-by: Aditya Arya <arya050411@gmail.com>
Signed-off-by: Aditya Arya <arya050411@gmail.com>
@Adityarya11
Adityarya11 force-pushed the feat/tck-wipeToken#2398 branch from 96165da to edd4b5c Compare July 20, 2026 10:02
@Adityarya11
Adityarya11 requested a review from manishdait July 20, 2026 10:02
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels Jul 20, 2026
@github-actions github-actions Bot added status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge and removed queue:committers PR awaiting committer technical review labels Jul 20, 2026
@exploreriii
exploreriii merged commit e8c9787 into hiero-ledger:main Jul 20, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown

👋 Hi @Adityarya11! Great work completing a Advanced issue! 🎉

Thanks for your contribution! 🚀

Here are some issues you might want to explore next:

🌟 Stay connected:

Happy coding! 🚀
— Hiero Python SDK Team

@Adityarya11
Adityarya11 deleted the feat/tck-wipeToken#2398 branch July 20, 2026 12:26
@MonaaEid MonaaEid added this to the v0.2.9 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member open to community review PR is open for community review and feedback scope: TCK involves engineering for the implementation of TCK method and module skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples status: Needs Developer Revision Author needs to apply suggested changes/improvements status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge status: update branch developer needs to click update branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add wipeToken endpoint to tck module

6 participants