Skip to content
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

Merged
merged 3 commits into from Mar 22, 2023

Conversation

algochoi
Copy link
Contributor

@algochoi algochoi commented Mar 22, 2023

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 the decode_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.

@algochoi algochoi changed the title Refactor Pending Transaction Information in ATC into try block ATC: Refactor Pending Transaction Information in ATC into try block Mar 22, 2023
@algochoi algochoi marked this pull request as ready for review March 22, 2023 04:30
self, method: abi.Method, txid: str, txn: Dict[str, Any]
) -> ABIResult:
tx_id = txid
raw_value = b""
Copy link
Contributor

Choose a reason for hiding this comment

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

bytes()?

Copy link
Contributor Author

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"",
Copy link
Contributor

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={},
Copy link
Contributor

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]?

Copy link
Contributor Author

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

Copy link
Member

@jasonpaulos jasonpaulos left a 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.

algosdk/atomic_transaction_composer.py Show resolved Hide resolved
@algochoi algochoi merged commit 8e3859a into develop Mar 22, 2023
@algochoi algochoi deleted the atc-execute-fix branch March 22, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants