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

New Feature: Adding methods to use the simulate endpoint #420

Merged
merged 25 commits into from
Mar 11, 2023
Merged

New Feature: Adding methods to use the simulate endpoint #420

merged 25 commits into from
Mar 11, 2023

Conversation

barnjamin
Copy link
Contributor

@barnjamin barnjamin commented Dec 13, 2022

Adding Simulate endpoint support to algod client

Also added simulate as a method on the AtomicTransactionComposer to allow an api like:
image

@barnjamin barnjamin changed the title Adding methods to use the simulate endpoint New Feature: Adding methods to use the simulate endpoint Jan 20, 2023
@@ -1,6 +1,6 @@
# Configs for testing repo download:
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
SDK_TESTING_BRANCH="master"
SDK_TESTING_BRANCH="simulate-endpoint-tests"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remember to change this back

Copy link
Contributor

Choose a reason for hiding this comment

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

i looked at the trap ray

Copy link
Contributor

Choose a reason for hiding this comment

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

@barnjamin barnjamin closed this Feb 27, 2023
@barnjamin barnjamin reopened this Feb 27, 2023
@barnjamin barnjamin closed this Feb 27, 2023
@barnjamin barnjamin reopened this Feb 27, 2023
@barnjamin barnjamin marked this pull request as ready for review February 28, 2023 16:37
Copy link
Contributor

@algochoi algochoi left a comment

Choose a reason for hiding this comment

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

Sorry for some of the sudden upstream SDK step-related changes - I commented the places where you might need to update it

algosdk/atomic_transaction_composer.py Show resolved Hide resolved
algosdk/atomic_transaction_composer.py Outdated Show resolved Hide resolved
tests/steps/other_v2_steps.py Outdated Show resolved Hide resolved
tests/steps/other_v2_steps.py Show resolved Hide resolved
tests/steps/other_v2_steps.py Outdated Show resolved Hide resolved
Copy link
Contributor

@algochoi algochoi 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 👍 minor comments and ready to approve when SDK testing PR is merged and the branch is reverted back to master.

def simulate_atc_failure(context, group, path, message):
resp: SimulateAtomicTransactionResponse = context.simulate_atc_response
group_idx: int = int(group)
fail_path = ",".join(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
fail_path = ",".join(
fail_path: str = ",".join(


for i, tx_id in enumerate(self.tx_ids):
tx_results = [
client.pending_transaction_info(tx_id) for tx_id in self.tx_ids
Copy link
Contributor

Choose a reason for hiding this comment

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

caveat/nit: I don't think we need to get the txn info for every transaction, just the ones with method calls (self.method_dict). If the call overhead isn't too bad, we could keep as written in the current PR.

.test-env Outdated Show resolved Hide resolved
def sign_transactions(
self, txn_group: List[transaction.Transaction], indexes: List[int]
) -> List[GenericSignedTransaction]:
stxns = []
Copy link
Contributor

Choose a reason for hiding this comment

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

- stxns = []
+ stxns: List[GenericSignedTransaction] = []

Copy link
Contributor

Choose a reason for hiding this comment

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

the linter is complaining error: Incompatible return value type

@bbroder-algo bbroder-algo merged commit ba95c33 into algorand:develop Mar 11, 2023
@barnjamin barnjamin deleted the simulate-endpoint branch March 13, 2023 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants