Skip to content

fix: align filename and improve error handling in token freeze example#1434

Merged
exploreriii merged 8 commits intohiero-ledger:mainfrom
ShrutiJ3110:fix-token-freeze-error-handling
Jan 24, 2026
Merged

fix: align filename and improve error handling in token freeze example#1434
exploreriii merged 8 commits intohiero-ledger:mainfrom
ShrutiJ3110:fix-token-freeze-error-handling

Conversation

@ShrutiJ3110
Copy link
Contributor

Fixes #1412

  • Removed incorrect run instructions
  • Improved error handling with broader exception catching

Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

Walkthrough

The changes refactor setup_client() to return a tuple of client, operator ID, and operator key instead of just the client. Exception handling is broadened from RuntimeError to Exception in error handlers, and status derivation in verify_freeze() is consolidated. A changelog entry documents these improvements.

Changes

Cohort / File(s) Summary
Token Freeze Example Refactoring
examples/tokens/token_freeze_transaction.py
Function signature refactored: setup_client() now returns (client, operator_id, operator_key) tuple. Exception handlers broadened from RuntimeError to Exception for wider error coverage. Status derivation consolidated in verify_freeze(). Minor docstring refinements.
Documentation
CHANGELOG.md
Added entry documenting alignment of token freeze example filename references and improved error handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: aligning filename references and improving error handling in the token freeze example file.
Description check ✅ Passed The description is related to the changeset, referencing issue #1412 and describing the removal of incorrect run instructions and improved error handling.
Linked Issues check ✅ Passed The PR addresses all coding requirements from issue #1412: removed incorrect run instructions, broadened exception handling from RuntimeError to Exception, and added proper changelog entry.
Out of Scope Changes check ✅ Passed All changes are in-scope: the PR modifies the token freeze example file as specified in issue #1412 and updates the changelog accordingly, with no unrelated changes detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c1310f and 53f7462.

📒 Files selected for processing (1)
  • .changes/1412.fix.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
.changes/1412.fix.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.changes/1412.fix.md (1)

1-1: Request the actual changed file for comprehensive review.

The PR modifies examples/tokens/token_freeze_transaction.py with error handling improvements and filename corrections, but this file is not included in the review context. To fully assess the changes, please provide the modified Python file so I can verify:

  • That incorrect run instructions referencing token_freeze.py have been removed
  • That the exception handling has been properly broadened from RuntimeError to Exception
  • That error messages and exit behavior are clear and appropriate
  • That the changes align with the PR objectives and don't introduce new issues

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @ShrutiJ3110
Thanks for the PR
We require a changelog entry to CHANGELOG.md and not a separate markdown file

@exploreriii exploreriii marked this pull request as draft January 10, 2026 19:17
Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
@ShrutiJ3110
Copy link
Contributor Author

Thanks for the clarification! I’ve moved the changelog entry to CHANGELOG.md and removed the separate markdown file as requested.

@github-actions
Copy link

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

To assist you, please read:

Thank you for contributing!

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @ShrutiJ3110
Yes please!
Keep one set of run instructions please so a future user knows how to execute this example 👍

Copy link
Contributor

@aceppaluni aceppaluni left a comment

Choose a reason for hiding this comment

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

@ShrutiJ3110 This is looking great! 👍

Please make sure to resolve merge conflicts. I linked our Merge-Conflicts.md file for assistance.

If you have questions or need more support, please reach out.

@exploreriii exploreriii reopened this Jan 16, 2026
@exploreriii
Copy link
Contributor

Reopening as confirmed working on it

Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
Copy link
Contributor

@MonaaEid MonaaEid left a comment

Choose a reason for hiding this comment

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

Alot of the changes in the example script aren’t required

@MonaaEid
Copy link
Contributor

You’ve handled the error handling and run instructions requirements successfully, but you changed something else that should have remained the same
please keep the rest of the script as it was

Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @ShrutiJ3110
This PR solves the issue! Well done

As mentioned you have gone beyond the scope of the issue requirements, which is against our workflow
You have:

  • deleted run instructions
  • changed set up handling
  • removed various comments
  • also made some improvements

We do agree improvements can be great, but to keep things easy to review and everyone in accordance with what should be done, each submission should have an issue linked to it. That means, if you want to improve a file (and there is no issue already for it), please create an issue, then create your pull request.

For this PR, it should thus ideally only change error handling - nothing else to operator or comments.

Can you please:

  • add a changelog entry in the correct fixed location for unreleased
  • restore lines 1 to 2, which are crucial instructions on how to run the file for new starters

Once this is done, in this case I will accept the other changes, once.

Thank you

Signed-off-by: Shruti Joshi <shrutisjoshi3110@gmail.com>
@ShrutiJ3110
Copy link
Contributor Author

Thanks for the feedback!
I’ve restored the run instructions and moved the changelog entry to the Unreleased → Fixed section as requested.
Please let me know if anything else is needed.

@github-actions
Copy link

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:

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1434   +/-   ##
=======================================
  Coverage   92.89%   92.89%           
=======================================
  Files         140      140           
  Lines        8765     8765           
=======================================
  Hits         8142     8142           
  Misses        623      623           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aceppaluni
Copy link
Contributor

Hi @ShrutiJ3110 , This is super awesome work!!

Can you check your changelog? There seems to be an error.
If you need assistance, please reach out. We are happy to help!

Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
Aligned token freeze example filename references and improved error handling.

Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
@exploreriii exploreriii marked this pull request as ready for review January 24, 2026 01:53
@exploreriii exploreriii dismissed stale reviews from MonaaEid and aceppaluni January 24, 2026 02:11

resolved

@exploreriii exploreriii merged commit 4ab6bf6 into hiero-ledger:main Jan 24, 2026
19 checks passed
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.

[Good First Issue]: Align file name and improve error handling in examples/tokens/token_freeze_transaction.py

4 participants