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: implement an estimate gas method #192

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

jinoosss
Copy link
Member

@jinoosss jinoosss commented Nov 26, 2024

Descriptions

Retrieve the estimated GasUsed by calling the simulate method of the ABCI query.

Send transaction data through the .app/simulate path to the ABCI query to extract GasUsed information from the executed result.

Related Issue

@jinoosss jinoosss marked this pull request as ready for review November 27, 2024 05:37
@jinoosss
Copy link
Member Author

gnolang/gno#1826 PR should be the first to be merged.

@zivkovicmilos zivkovicmilos marked this pull request as draft November 28, 2024 04:06
@jinoosss jinoosss force-pushed the feat/implement-an-estimage-gas-method branch from e1ffd83 to 9e45d2c Compare November 28, 2024 04:40
@jinoosss jinoosss marked this pull request as ready for review January 11, 2025 11:48
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Works great 👏 👏 👏

A giant leap in UX 🙏

One idea we can improve is how the Tx lifecycle is implemented. Right now we have methods that (in 1):

  • create a tx
  • sign the tx
  • broadcast the tx

when in reality these should be separate, and allow the user to modify bits and pieces they want; but this is for a future PR 🫡

@zivkovicmilos zivkovicmilos merged commit 9a40708 into main Jan 13, 2025
2 checks passed
zivkovicmilos added a commit to gnolang/gno that referenced this pull request Jan 14, 2025
## Description

Closes #1826 along with
gnolang/tm2-js-client#192

This PR introduces a method `EstimateGas` to estimate the gas used by a
transaction in gnoclient.
We can use this call to get a ballpark estimate if a transaction
succeeds, and if it does, how much gas it actually used.
@jinoosss jinoosss deleted the feat/implement-an-estimage-gas-method branch January 20, 2025 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants