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

Simulate: Fix simulate request error & support ATC simulation #611

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

jasonpaulos
Copy link
Contributor

@jasonpaulos jasonpaulos commented Sep 14, 2023

A user reported that the following error occurred when trying to use the algod simulate endpoint:

HTTP 400: {"message":"failed to decode object: json decode error [pos 13]: no matching struct field found when decoding stream map with key Format"}

I reproduced the error and saw that it was because the simulate endpoint needed to be added to rawRequestPaths, otherwise the code uses the query params as the POST body. This required a code generation change as well: algorand/generator#68

In order to add coverage, I enabled the @simulate cucumber tests and added the necessary step defs.

Note that these tests also cover simulating with the AtomicTransactionComposer, which this SDK didn't support. Instead of modifying the test tags to separate this out (and updating the other SDKs' tags), I ended up implementing the missing feature instead.

@jasonpaulos jasonpaulos changed the title Fix simulate requests & support ATC simulation Simulate: Fix simulate request error & support ATC simulation Sep 14, 2023
@jasonpaulos jasonpaulos self-assigned this Sep 14, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes here are from algorand/generator#68

@jasonpaulos jasonpaulos marked this pull request as ready for review September 14, 2023 16:41
@jasonpaulos jasonpaulos merged commit 5c2f06a into develop Sep 15, 2023
5 checks passed
@jasonpaulos jasonpaulos deleted the simulate-fix branch September 15, 2023 13:44
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.

2 participants