-
Notifications
You must be signed in to change notification settings - Fork 204
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
algod: Minor improvements to simulation support #749
Conversation
txHeaders | ||
txHeaders, | ||
this.query, | ||
false |
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.
this parseBody
parameter seems to parse to JSON by default:
https://github.com/algorand/js-algorand-sdk/blob/develop/src/client/client.ts#L261
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.
I think the underlying problem is that post
and delete
assume the response is always application/json
. Probably they should use getAcceptFormat(query)
like get
does to figure out the actual response format.
But I'm ok with leaving this as-is for now, since passing parseBody
as false is sufficient for the time being. We can address that problem with a separate issue/PR
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.
I opened #751
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.
🚀
This PR makes some minor, but important changes to the simulate support introduced in #743. They are:
SimulateRawTransactions
was returning a raw object instead of an instance ofSimulateResponse
. Based on the code I think we wanted aSimulateResponse
AtomicTransactionComposer.execute
. I made a new try-catch block to include it again. This is especially important because it can be dangerous if a client thinks a transaction was rejected due to an error observing its result, but in reality the transaction succeeded.