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: add EstimateGas to gnoclient #3498

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

zivkovicmilos
Copy link
Member

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.

@zivkovicmilos zivkovicmilos added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jan 13, 2025
@zivkovicmilos zivkovicmilos requested a review from gfanton January 13, 2025 12:26
@zivkovicmilos zivkovicmilos self-assigned this Jan 13, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Jan 13, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gno.land/pkg/gnoclient/client_txs.go 75.00% 4 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@gfanton gfanton 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 👍

@zivkovicmilos zivkovicmilos merged commit d54d004 into master Jan 14, 2025
56 checks passed
@zivkovicmilos zivkovicmilos deleted the dev/zivkovicmilos/gnoclient-estimate branch January 14, 2025 14:16
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

just 2c post merge: shouldn't we expose the Simulate method?

The problem I see with this method is that it still requires for us to encode a transaction where on the user side we put the maximum gas value. Because of that, having a Simulate method, which can be used for other use-cases, seems more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Development

Successfully merging this pull request may close these issues.

[chain] Gas Estimations
4 participants