chore: update imports to include Key from crypto module#2196
Conversation
Signed-off-by: MonaaEid <monaa_eid@hotmail.com>
Up to standards ✅🟢 Issues
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #2196 +/- ##
=======================================
Coverage 93.70% 93.70%
=======================================
Files 145 145
Lines 9470 9474 +4
=======================================
+ Hits 8874 8878 +4
Misses 596 596 🚀 New features to boost your workflow:
|
|
@MonaaEid, This seems fine to me. can you double check if there is any other file using the Key type-alias |
Signed-off-by: MonaaEid <monaa_eid@hotmail.com>
Signed-off-by: MonaaEid <monaa_eid@hotmail.com>
I’ve checked, and no other file is using the Key type-alias |
There was a problem hiding this comment.
Pull request overview
Standardizes internal SDK imports to reference the canonical Key base class from hiero_sdk_python.crypto.key (instead of importing it via hiero_sdk_python.utils.key_utils), aligning with the crypto module’s intended structure and resolving #2195.
Changes:
- Update
Transactionto importKeyfromhiero_sdk_python.crypto.keywhile continuing to usekey_to_protofromutils.key_utils. - Update
TokenCreateTransactionandTokenUpdateTransactionto importKeyfrom the crypto module. - Update
TopicCreateTransactionto importKeyfrom the crypto module.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/hiero_sdk_python/transaction/transaction.py | Switches Key import to hiero_sdk_python.crypto.key while keeping key_to_proto usage unchanged. |
| src/hiero_sdk_python/tokens/token_update_transaction.py | Switches Key import to the crypto module for key-typed fields and parameters. |
| src/hiero_sdk_python/tokens/token_create_transaction.py | Switches Key import to the crypto module for key-typed fields and parameters. |
| src/hiero_sdk_python/consensus/topic_create_transaction.py | Switches Key import to the crypto module for key-typed fields and parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis change updates the import source for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ 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 |
Description:
This PR refactors imports across several modules to improve code organization and clarity. The main change is moving the import of the
Keyclass fromhiero_sdk_python.utils.key_utilsto its own dedicated module,hiero_sdk_python.crypto.key, while keeping thekey_to_protoimport unchanged. This helps separate cryptographic functionality from utility functions and makes the codebase more maintainable.Related issue(s):
Fixes #2195
Checklist