Skip to content

feat(tck): implement unpauseToken JSON-RPC method - #2613

Merged
manishdait merged 11 commits into
hiero-ledger:mainfrom
anchit-goel:unpause-token
Sep 1, 2026
Merged

feat(tck): implement unpauseToken JSON-RPC method#2613
manishdait merged 11 commits into
hiero-ledger:mainfrom
anchit-goel:unpause-token

Conversation

@anchit-goel

Copy link
Copy Markdown
Contributor

Description:
Implement the unpauseToken TCK JSON-RPC method by mirroring the existing pauseToken implementation across the TCK token parameters, responses, and RPC handler modules.

  • Add UnpauseTokenParams dataclass inheriting from BaseTransactionParams with tokenId and parse_json_params in tck/param/token.py
  • Add UnpauseTokenResponse status-only dataclass in tck/response/token.py
  • Add _build_unpause_token_transaction helper and @rpc_method("unpauseToken") handler in tck/handlers/token.py

Related issue(s):

Fixes #2420

Notes for reviewer:

  • Follows the exact pattern of pauseToken in tck/handlers/token.py, tck/param/token.py, and tck/response/token.py.
  • Preserves SDK validation behavior allowing handle_sdk_errors to map validation errors to JSON-RPC errors.
  • Verified with unit tests (uv run pytest tests/unit/token_unpause_transaction_test.py) and code style tools (ruff check tck/ & ruff format --check tck/).

Checklist

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

Signed-off-by: anchit-goel <anchitgoel5@gmail.com>
@anchit-goel
anchit-goel marked this pull request as ready for review August 26, 2026 16:50
@anchit-goel
anchit-goel requested a review from a team as a code owner August 26, 2026 16:50
@anchit-goel
anchit-goel requested review from danielmarv and a lite review from Copilot August 26, 2026 16:50

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The TCK now supports the unpauseToken JSON-RPC method. It parses request parameters, builds and executes TokenUnpauseTransaction, validates the receipt, and returns the transaction status. Unset token IDs now reach network validation.

Changes

UnpauseToken RPC

Layer / File(s) Summary
UnpauseToken request and response contracts
tck/param/token.py, tck/response/token.py
Adds UnpauseTokenParams for JSON-RPC input and UnpauseTokenResponse for the status result.
UnpauseToken transaction handler
tck/handlers/token.py
Registers unpauseToken, builds the transaction, applies common parameters, validates the receipt, and returns the status response.
Unset token ID validation
src/hiero_sdk_python/tokens/token_unpause_transaction.py, tests/integration/token_unpause_transaction_e2e_test.py, tests/unit/token_unpause_transaction_test.py
Allows transaction-body construction without a token field and preserves an absent token during deserialization. The tests verify body construction, deserialization, and the INVALID_TOKEN_ID receipt status.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 78728

The PR adds the unpauseToken RPC path and related tests. The implementation is localized, but the integration tests should verify the exact error code and use a token ID guaranteed not to exist, avoiding misleading or environment-dependent results. This bounded test-readiness risk is mergeable with explicit follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant unpause_token
  participant TokenUnpauseTransaction
  participant Network
  Client->>unpause_token: unpauseToken parameters
  unpause_token->>TokenUnpauseTransaction: Build and execute transaction
  TokenUnpauseTransaction->>Network: Submit transaction
  Network-->>unpause_token: Return transaction receipt
  unpause_token-->>Client: UnpauseTokenResponse
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the implementation of the missing unpauseToken TCK JSON-RPC method.
Description check ✅ Passed The description directly explains the unpauseToken implementation, affected modules, testing, and linked issue.
Linked Issues check ✅ Passed The changes satisfy issue #2420 by adding UnpauseTokenParams, UnpauseTokenResponse, the transaction builder, and the unpauseToken RPC handler. The SDK and tests also support the required missing-token…
Out of Scope Changes check ✅ Passed The SDK adjustment and related unit and integration test updates support the unpauseToken behavior and validation required by issue #2420. No unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 6 files.
Full details: Linked Issues check

Explanation

The changes satisfy issue #2420 by adding UnpauseTokenParams, UnpauseTokenResponse, the transaction builder, and the unpauseToken RPC handler. The SDK and tests also support the required missing-token validation behavior.

✨ 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.

@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Aug 26, 2026
aceppaluni
aceppaluni previously approved these changes Aug 26, 2026

@aceppaluni aceppaluni 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.

LGTM

@aceppaluni
aceppaluni requested a review from manishdait August 26, 2026 22: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 Aug 26, 2026
Comment thread tck/handlers/token.py

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a81490f5-d2d7-4de4-9907-464e33f657e7

📥 Commits

Reviewing files that changed from the base of the PR and between 7de90ed and a9d53c4.

📒 Files selected for processing (3)
  • src/hiero_sdk_python/tokens/token_unpause_transaction.py
  • tests/integration/token_unpause_transaction_e2e_test.py
  • tests/unit/token_unpause_transaction_test.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread src/hiero_sdk_python/tokens/token_unpause_transaction.py
@github-actions github-actions Bot added queue:junior-committer PR awaiting initial quality review and removed queue:committers PR awaiting committer technical review labels Aug 28, 2026
manishdait
manishdait previously approved these changes Aug 31, 2026
@github-actions github-actions Bot added the approved Issue has been approved by team member label Aug 31, 2026

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bf787b6d-0c29-49cb-9175-4230a6d88a59

📥 Commits

Reviewing files that changed from the base of the PR and between a9d53c4 and dfb4bb8.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/tokens/token_unpause_transaction.py
  • tests/unit/token_unpause_transaction_test.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread tests/unit/token_unpause_transaction_test.py Outdated
…useTransaction unit tests

Signed-off-by: anchit-goel <anchitgoel5@gmail.com>

@danielmarv danielmarv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address pre-commit errors

Signed-off-by: anchit-goel <anchitgoel5@gmail.com>
@anchit-goel

Copy link
Copy Markdown
Contributor Author

Please address pre-commit errors

there is a issue with uv.lock file it seems, it gets changed everytime, I try to find out a solution.

@danielmarv danielmarv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please rectify the issue with the intergration tests coz they are not passing

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: e76ec288-224a-4f71-bd34-97e01e9835b3

📥 Commits

Reviewing files that changed from the base of the PR and between e0225bf and 7872878.

📒 Files selected for processing (1)
  • tests/integration/token_unpause_transaction_e2e_test.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread tests/integration/token_unpause_transaction_e2e_test.py Outdated
Comment thread tests/integration/token_unpause_transaction_e2e_test.py Outdated
…unpause_transaction_e2e_test.py

Signed-off-by: anchit-goel <anchitgoel5@gmail.com>
@anchit-goel
anchit-goel marked this pull request as draft September 1, 2026 09:24
…ork-guaranteed invalid TokenId

Signed-off-by: anchit-goel <anchitgoel5@gmail.com>
@anchit-goel
anchit-goel marked this pull request as ready for review September 1, 2026 09:29
@danielmarv

Copy link
Copy Markdown
Member

some commits are not having the gpg signing

@anchit-goel

Copy link
Copy Markdown
Contributor Author

resolved that issue. all commits in this branch should now be signed.

@danielmarv

Copy link
Copy Markdown
Member

aah sorry for that mine was stale

@anchit-goel

Copy link
Copy Markdown
Contributor Author

test runs complete.

@danielmarv danielmarv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@manishdait
manishdait merged commit 7f739eb into hiero-ledger:main Sep 1, 2026
33 checks passed
@anchit-goel
anchit-goel deleted the unpause-token branch September 1, 2026 10:30
@manishdait

Copy link
Copy Markdown
Contributor

@anchit-goel, Thanks for the PR :)

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

👋 Hi @anchit-goel! Great work completing a Beginner issue! 🎉

Thanks for your contribution! 🚀

🏆 Milestone unlocked: you've reached Intermediate level! 🎉

Here are some issues you might want to explore next:

🌟 Stay connected:

Happy coding! 🚀
— Hiero Python SDK Team

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 queue:junior-committer PR awaiting initial quality review skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tck): implement unpauseToken JSON-RPC method

6 participants