-
Notifications
You must be signed in to change notification settings - Fork 144
chore: rename/response code name #1151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: rename/response code name #1151
Conversation
…pt.status).name Signed-off-by: Chaitanya-chute <[email protected]>
Signed-off-by: Chaitanya-chute <[email protected]>
WalkthroughThis PR standardizes enum naming conventions by replacing all instances of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ 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 |
|
Hi, this is WorkflowBot.
|
There was a problem hiding this comment.
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 refactors response code name retrieval to use the canonical Python enum pattern. The change replaces the custom ResponseCode.get_name(receipt.status) method with the standard ResponseCode(receipt.status).name approach across examples and integration tests.
- Standardizes response code name retrieval using Python's built-in enum
.nameproperty - Updates error messages in assertions to use the canonical pattern
- Updates CHANGELOG to document this refactoring change
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/token_update_transaction_e2e_test.py | Replaces 35 instances of ResponseCode.get_name() with ResponseCode().name in token update test assertions |
| tests/integration/token_revoke_kyc_transaction_e2e_test.py | Updates 10 instances in token revoke KYC test assertions |
| tests/integration/file_update_transaction_e2e_test.py | Updates 4 instances in file update test assertions |
| examples/tokens/token_update_transaction_nft.py | Updates 2 instances in NFT token update example error messages |
| examples/tokens/token_update_transaction_key.py | Updates 2 instances in token key update example error messages |
| examples/tokens/token_update_transaction_fungible.py | Updates 2 instances in fungible token update example error messages |
| examples/tokens/token_revoke_kyc_transaction.py | Updates 5 instances in token revoke KYC example error messages |
| examples/query/payment_query.py | Updates 1 instance in payment query example error message |
| CHANGELOG.md | Documents the refactoring change in the Changed section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this 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: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
CHANGELOG.md(1 hunks)examples/query/payment_query.py(1 hunks)examples/tokens/token_revoke_kyc_transaction.py(4 hunks)examples/tokens/token_update_transaction_fungible.py(2 hunks)examples/tokens/token_update_transaction_key.py(2 hunks)examples/tokens/token_update_transaction_nft.py(2 hunks)tests/integration/file_update_transaction_e2e_test.py(4 hunks)tests/integration/token_revoke_kyc_transaction_e2e_test.py(10 hunks)tests/integration/token_update_transaction_e2e_test.py(30 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
examples/tokens/token_update_transaction_key.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
examples/query/payment_query.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
tests/integration/token_update_transaction_e2e_test.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
examples/tokens/token_update_transaction_nft.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
tests/integration/file_update_transaction_e2e_test.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
examples/tokens/token_update_transaction_fungible.py (1)
src/hiero_sdk_python/response_code.py (1)
ResponseCode(4-387)
⏰ 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). (4)
- GitHub Check: Title Check
- GitHub Check: Agent
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: StepSecurity Harden-Runner
🔇 Additional comments (10)
examples/query/payment_query.py (1)
64-64: LGTM! Correctly using the non-deprecated enum name access.The change from
ResponseCode.get_name(receipt.status)toResponseCode(receipt.status).namecorrectly adopts the recommended pattern and eliminates the deprecation warning.CHANGELOG.md (1)
76-77: LGTM! Changelog properly documents the refactoring.The changelog entry clearly describes the replacement of the deprecated
ResponseCode.get_name()method with the recommendedResponseCode(receipt.status).namepattern, and correctly references issue #1136.tests/integration/file_update_transaction_e2e_test.py (1)
32-32: LGTM! Test assertions correctly updated to use non-deprecated method.All assertion messages now use
ResponseCode(receipt.status).nameinstead of the deprecatedResponseCode.get_name(receipt.status), maintaining consistency across the test file.Also applies to: 56-56, 88-88, 124-124
examples/tokens/token_update_transaction_nft.py (1)
73-73: LGTM! Error messages correctly updated.Both error messages now use the non-deprecated
ResponseCode(receipt.status).namepattern for consistent status reporting.Also applies to: 112-112
examples/tokens/token_update_transaction_key.py (1)
65-65: LGTM! Correctly adopting the recommended enum access pattern.Both error messages have been updated to use
ResponseCode(receipt.status).name, eliminating deprecation warnings.Also applies to: 109-109
examples/tokens/token_update_transaction_fungible.py (1)
73-73: LGTM! Error messages properly refactored.Both error messages now use the recommended
ResponseCode(receipt.status).nameapproach instead of the deprecatedget_name()method.Also applies to: 112-112
examples/tokens/token_revoke_kyc_transaction.py (1)
71-71: LGTM! All error messages consistently refactored.All five error messages throughout the file have been properly updated to use
ResponseCode(receipt.status).name, eliminating deprecation warnings and maintaining consistency with the rest of the codebase.Also applies to: 95-95, 121-121, 145-145, 192-192
tests/integration/token_revoke_kyc_transaction_e2e_test.py (3)
27-60: LGTM! Correctly migrated to canonical enum name access.All assertion messages in this test function have been properly updated to use
ResponseCode(receipt.status).nameinstead of the deprecatedResponseCode.get_name()method. The changes align with the deprecation warning and follow Python enum best practices.
79-112: LGTM! Consistent migration pattern applied.All assertion messages correctly use the canonical
ResponseCode(receipt.status).namesyntax. The changes are consistent with the first test function.
131-144: LGTM! Migration complete for this test file.The final assertion messages have been correctly updated to use the canonical enum name access pattern. All instances of the deprecated
ResponseCode.get_name()method have been successfully replaced in this file.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1151 +/- ##
=======================================
Coverage 91.11% 91.11%
=======================================
Files 139 139
Lines 8451 8451
=======================================
Hits 7700 7700
Misses 751 751 🚀 New features to boost your workflow:
|
Signed-off-by: Chaitanya-chute <[email protected]> Signed-off-by: prajeeta pal <[email protected]>
Description:
Replace all usages of
ResponseCode.get_name(receipt.status)with the canonicalResponseCode(receipt.status).name.ResponseCode.get_name(receipt.status)in examplesResponseCode.get_name(receipt.status)in integration testsFixes #1136
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.