-
Notifications
You must be signed in to change notification settings - Fork 235
Fix: child receipt account #2013
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
Open
Mounil2005
wants to merge
13
commits into
hiero-ledger:main
Choose a base branch
from
Mounil2005:fix/child-receipt-account-id
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
126b382
fix: Pass None for child transaction IDs in receipt queries
Mounil2005 999917e
test: Add verification test for child receipt account_id accessibility
Mounil2005 351c5e5
docs: Update CHANGELOG for child receipt account_id fix
Mounil2005 9736e56
docs: Restore Key class entry in CHANGELOG
Mounil2005 dfdf18a
fix: Remove accountNum==0 filter from account_id property
Mounil2005 6739523
test: Add duplicate receipt account_id regression test
Mounil2005 a4fa115
test, refactor: Add transaction_id assertions and type hints
Mounil2005 4bf823a
test: Add comprehensive integration tests for child/duplicate receipt…
Mounil2005 ab3fc10
test: Fix integration tests per CodeRabbit review
Mounil2005 6a19b84
test: Add auto-account creation e2e test for account_id fix
Mounil2005 12aff7b
Address failing PR checks
Mounil2005 0ce7410
update changelog
Mounil2005 aeb33d4
update docstring
Mounil2005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,13 +89,15 @@ def account_id(self) -> Optional[AccountId]: | |
| """ | ||
| Retrieves the AccountId associated with the transaction receipt, if available. | ||
|
|
||
| Unlike other ID properties (token_id, file_id, etc.), this returns the AccountId | ||
| even when accountNum is 0. This is intentional to support EVM auto-account creation | ||
| scenarios where the protobuf may contain an AccountID with num=0 to identify the | ||
| newly created account before it's fully initialized on-chain. | ||
|
|
||
| Returns: | ||
| AccountId or None: The AccountId if present; otherwise, None. | ||
| AccountId or None: The AccountId if present (including num=0); otherwise, None. | ||
| """ | ||
| if ( | ||
| self._receipt_proto.HasField("accountID") | ||
| and self._receipt_proto.accountID.accountNum != 0 | ||
| ): | ||
| if self._receipt_proto.HasField("accountID"): | ||
| return AccountId._from_proto(self._receipt_proto.accountID) | ||
| return None | ||
|
|
||
|
|
@@ -257,12 +259,12 @@ def _to_proto(self): | |
| return self._receipt_proto | ||
|
|
||
| @classmethod | ||
| def _from_proto(cls, proto: transaction_receipt_pb2.TransactionReceipt, transaction_id: TransactionId) -> "TransactionReceipt": | ||
| def _from_proto(cls, proto: transaction_receipt_pb2.TransactionReceipt, transaction_id: TransactionId | None) -> "TransactionReceipt": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| """ | ||
| Creates a TransactionReceipt instance from a protobuf TransactionReceipt object. | ||
| Args: | ||
| proto (transaction_receipt_pb2.TransactionReceipt): The protobuf TransactionReceipt object. | ||
| transaction_id (TransactionId): The transaction ID associated with this receipt. | ||
| transaction_id (TransactionId | None): The transaction ID associated with this receipt. Can be None for child receipts. | ||
| Returns: | ||
| TransactionReceipt: A new instance of TransactionReceipt populated with data from the protobuf object. | ||
| """ | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.