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
ATC: Refactor Pending Transaction Information in ATC into try block #451
Conversation
self, method: abi.Method, txid: str, txn: Dict[str, Any] | ||
) -> ABIResult: | ||
tx_id = txid | ||
raw_value = b"" |
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.
bytes()
?
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.
they are functionally the same, but I changed all instances of empty byte literals to bytes()
just in case it helps for readability in 5e2d2b7
tx_id = self.tx_ids[method_index] | ||
result: ABIResult = ABIResult( | ||
tx_id=tx_id, | ||
raw_value=b"", |
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.
bytes()
?
raw_value=b"", | ||
return_value=None, | ||
decode_error=None, | ||
tx_info={}, |
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.
tx_info = txn_results[method_index]
?
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.
good point! addressed in 5e2d2b7
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.
Looks good, thanks for making this change.
I have an inconsequential comment about one of your claims for this PR, but that's by no means a blocker.
This PR moves back the pending_transaction_information call in the ATC into a try block. This PR also refactors the
parse_response
helper method so individual ABI result are parsed at a time (instead of the entire group), and can report thedecode_error
at the transaction level. This also reduces the total number of pending tx info calls we potentially make, as we only need to call them for ABI Method calls in the transaction group.