Skip to content

Conversation

@gangulysiddhartha22-cmyk
Copy link
Contributor

Description:
Refactors to use the simpler Client.from_env()

Related issue(s):

Fixes #1611

Notes for reviewer:
The script runs successfully on testnet when OPERATOR_ID and OPERATOR_KEY are set and the account has test HBAR.

Checklist

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

Refactored examples/consensus/topic_create_transaction.py to initialize the client via Client.from_env() instead of manual dotenv and environment parsing. Simplified imports and updated CHANGELOG.md. Only the module-local setup_client() return annotation changed (now returns (client, client.operator_private_key)).

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added entry documenting refactor of examples/consensus/topic_create_transaction.py to use Client.from_env().
Example Refactor
examples/consensus/topic_create_transaction.py
Removed dotenv, os, sys, manual OPERATOR_ID/OPERATOR_KEY parsing and validation. Replaced setup with Client.from_env(), simplified imports to Client, TopicCreateTransaction, ResponseCode, PrivateKey. setup_client() now returns (client, client.operator_private_key) and prints network/operator info. Adjusted error/receipt handling and removed legacy environment parsing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: refactoring to use Client.from_env() in topic_create_transaction.py.
Description check ✅ Passed The description is directly related to the changeset, explaining the refactoring to use Client.from_env() and linking to the associated issue.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from #1611: replaced manual client setup with Client.from_env(), updated imports, removed dotenv usage, modified setup_client() function, and added CHANGELOG.md entry.
Out of Scope Changes check ✅ Passed All changes are within scope of #1611: the modifications are limited to refactoring the example file and updating documentation as specified.
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.


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.

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

Signed-off-by: Siddhartha Ganguly <[email protected]>
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1619   +/-   ##
=======================================
  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.

@gangulysiddhartha22-cmyk
Copy link
Contributor Author

@rwalworth Ready for review. Thanks!

@github-actions
Copy link

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (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

@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

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

This is looking good!

Requesting additional reviews from @hiero-ledger/hiero-sdk-python-triage

Copy link
Contributor

@prajeeta15 prajeeta15 left a comment

Choose a reason for hiding this comment

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

this is great!
thank you so much for your contribution :D

@aceppaluni
Copy link
Contributor

@gangulysiddhartha22-cmyk

Please be sure to address merge conflicts.
If you need assistance please reach out. We're happy to help!

@gangulysiddhartha22-cmyk
Copy link
Contributor Author

@aceppaluni the merge conflict has been successfully resolved using the web UI. Thank you!

Copy link

@rwalworth rwalworth left a comment

Choose a reason for hiding this comment

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

LGTM!

@exploreriii exploreriii merged commit 14cda1e into hiero-ledger:main Jan 30, 2026
19 checks passed
@exploreriii
Copy link
Contributor

Great work @gangulysiddhartha22-cmyk thank you again!

@github-actions
Copy link

🎉 Congratulations on completing a beginner/Good First Issue!

Thank you for your contribution to the Hiero Python SDK! We're excited to have you as part of our community.

Here are some beginner-level issues you might be interested in working on next:

  1. [Beginner]: Add Missing Type Hint to to_bytes Method in Transaction Class

    🐥 Beginner Friendly This issue is intended for contributors who have previously completed a Good First Issue in Hiero and are at a beginner level....

  2. [Beginner]: Add Missing Type Hints to sign Method in Transaction Class

    🐥 Beginner Friendly This issue is intended for contributors who have previously completed a Good First Issue in Hiero and are at a beginner level....

  3. [Beginner]: Implement __repr__ Method for TopicId Class

    🐥 Beginner Friendly This issue is intended for contributors who have previously completed a Good First Issue in Hiero and are at a beginner level....

  4. [Beginner]: Implement __repr__ Method for FileId Class

    🐥 Beginner Friendly This issue is intended for contributors who have previously completed a Good First Issue in Hiero and are at a beginner level....

  5. [Beginner]: Implement __repr__ Method for NftId Class

    🐥 Beginner Friendly This issue is intended for contributors who have previously completed a Good First Issue in Hiero and are at a beginner level....

🌟 Stay connected with the project:

We look forward to seeing more contributions from you! If you have any questions, feel free to ask in our Discord community.

From the Hiero Python SDK Team 🚀

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]: Refactor topic_create_transaction.py to use Client.from_env()

5 participants