Skip to content

test: pr coderabbit proto#213

Open
exploreriii wants to merge 11 commits intomainfrom
test-PR-coderabbit-proto
Open

test: pr coderabbit proto#213
exploreriii wants to merge 11 commits intomainfrom
test-PR-coderabbit-proto

Conversation

@exploreriii
Copy link
Owner

Description:

Related issue(s):

Fixes #1

Notes for reviewer:

Checklist

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

mukundkumarjha and others added 11 commits January 26, 2026 12:49
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: Mukund Jha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com>
Signed-off-by: Mukund Jha <mukundiiitg@gmail.com>
Signed-off-by: Mukund Jha <mukundiiitg@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 8, 2026

Walkthrough

This PR refactors the AccountInfo class to consolidate three separate staking-related fields (staked_account_id, staked_node_id, decline_staking_reward) into a single composite StakingInfo field. Proto conversion, serialization, and string representations are updated to reflect this structural change. Tests are updated accordingly.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added changelog entry documenting the AccountInfo refactoring from individual staking fields to staking_info composite field.
Core Implementation
src/hiero_sdk_python/account/account_info.py
Replaced three staking fields with single staking_info: Optional[StakingInfo] field. Updated imports, _from_proto() and _to_proto() methods to handle StakingInfo object conversion. Modified __str__() and __repr__() to display staking information via the composite field.
Account Info Tests
tests/unit/account_info_test.py
Added test coverage for new staking_info and max_automatic_token_associations fields. Updated initialization, proto conversion round-trip tests, and field persistence assertions.
Topic Info Tests
tests/unit/topic_info_test.py
Adjusted test assertions for expiration_time string representation from full datetime to date-only format (YYYY-MM-DD).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 4
❌ Failed checks (4 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'test: pr coderabbit proto' is vague and does not clearly describe the actual changes made to refactor AccountInfo to use staking_info. Consider using a more descriptive title such as 'refactor: consolidate AccountInfo staking fields into StakingInfo' to better reflect the primary changes.
Description check ❓ Inconclusive The description is a template with placeholder text and unchecked boxes, lacking meaningful detail about the actual code changes and their purpose. Fill in the description with a clear summary of changes, such as explaining the refactoring of staking fields and updates to AccountInfo.
Linked Issues check ❓ Inconclusive The linked issue #1 'feat: verification bot' with description 'test' is too vague to determine if code changes meet its requirements or if they are related. Clarify the objectives in issue #1 or link to more specific issues that describe the staking_info refactoring requirements.
Out of Scope Changes check ❓ Inconclusive The changes primarily refactor AccountInfo staking fields and add test coverage, but the vague linked issue makes it difficult to assess whether all changes are in scope. Clarify the scope in the linked issue to confirm all refactoring work and test updates are intentional and in scope.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 88.89% 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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-PR-coderabbit-proto

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/hiero_sdk_python/account/account_info.py (1)

41-43: ⚠️ Potential issue | 🟡 Minor

Docstring is outdated - references removed fields.

The docstring still documents staked_account_id, staked_node_id, and decline_staking_reward as direct attributes of AccountInfo, but these have been replaced by the composite staking_info field.

Proposed fix
         account_memo (Optional[str]): The memo associated with this account.
         owned_nfts (Optional[int]): The number of NFTs owned by this account.
-        staked_account_id (Optional[AccountId]): The account to which this account is staked.
-        staked_node_id (Optional[int]): The node to which this account is staked.
-        decline_staking_reward (bool): Whether this account declines receiving staking rewards. 
+        max_automatic_token_associations (Optional[int]): Maximum automatic token associations.
+        staking_info (Optional[StakingInfo]): Staking-related information for this account.
     """

- Replaced the docstring in `entity_id_helper.py` with one that is correct. (#1623)

### Changed
- Refactored AccountInfo class to use the staking_info(#1366)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor formatting inconsistency: missing space before issue reference.

Other entries in this file follow the pattern description (#issue) with a space before the parenthesis. This entry has staking_info(hiero-ledger#1366) without a space.

Suggested fix
-- Refactored AccountInfo class to use the staking_info(`#1366`)
+- Refactored AccountInfo class to use the staking_info (`#1366`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Refactored AccountInfo class to use the staking_info(#1366)
- Refactored AccountInfo class to use the staking_info (`#1366`)

f"account_memo={self.account_memo!r}, "
f"staked_node_id={self.staked_node_id!r}, "
f"staked_account_id={self.staked_account_id!r}"
f"staked_info={self.staking_info!r}, "
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent field name in __repr__: uses staked_info instead of staking_info.

The field is named staking_info but the __repr__ output uses staked_info=. This inconsistency could cause confusion during debugging.

Proposed fix
-            f"staked_info={self.staking_info!r}, "
+            f"staking_info={self.staking_info!r}, "
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
f"staked_info={self.staking_info!r}, "
f"staking_info={self.staking_info!r}, "

assert account_info.account_memo == "Test account memo"
assert account_info.owned_nfts == 5
assert account_info.max_automatic_token_associations == 10
assert account_info.staking_info == None
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use is None instead of == None for None comparisons.

Per PEP 8 and the static analysis hint, comparisons to None should use is None.

Proposed fix
-    assert account_info.staking_info == None
+    assert account_info.staking_info is None
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert account_info.staking_info == None
assert account_info.staking_info is None
🧰 Tools
🪛 Ruff (0.14.14)

[error] 153-153: Comparison to None should be cond is None

Replace with cond is None

(E711)

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

[commit-verification-bot]
Hi, this is VerificationBot.
Your pull request cannot be merged as it has 1 unverified commit(s):

  • 9832ebd Merge branch 'accountinfo' into test-PR-coderabbit

View your commit verification status: Commits Tab.

To achieve verified status, please read:

Remember, you require a GPG key and each commit must be signed with:
git commit -S -s -m "Your message here"

Thank you for contributing!

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.

2 participants