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

feat: simulate with mode #13424

Closed
wants to merge 3 commits into from
Closed

feat: simulate with mode #13424

wants to merge 3 commits into from

Conversation

emidev98
Copy link
Contributor

@emidev98 emidev98 commented Sep 29, 2022

Description

This pull request puts the Simulate and Broadcast transaction closer to parity. When a transaction fails on-chain it will anyways return the gas used. Same as developed in this PR to return the gas used but in order to avoid breaking changes I have decided to add a new field named mode which by default it behaves as know until now, but when the mode is set to GAS_USED it will return also the amount of gas used with the status code 200 even if the simulation fails.

Author Checklist

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

model GAS_USED

image

model WITH_RESULT

image

model undefined

image

@emidev98 emidev98 requested a review from a team as a code owner September 29, 2022 19:08
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Hey @emidev98 thanks for the contribution!

To be honest, it wasn't clear to me from the title or the description what this PR is actually for...I'd suggest tweaking that a bit.

However, after looking at the changes I see what you're trying to achieve and why. However, I don't think it's necessary. At least there is a somewhat easier way of going about it. What I'd suggest is actually adding context to the err itself. Because I believe it's still useful to return an error -- so let's just add context to it. WDYT?

@emidev98
Copy link
Contributor Author

emidev98 commented Oct 3, 2022

@alexanderbez I close this PR since I have create this new one with the only changes you suggested #13435

@emidev98 emidev98 closed this Oct 3, 2022
@emidev98 emidev98 deleted the feat_simulate-with-mode branch October 3, 2022 09:13
@alexanderbez
Copy link
Contributor

Thanks for the contribution @emidev98! Amazing work 👏

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.

2 participants