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

Simplify gas estimation flow #169

Merged
merged 2 commits into from
Jan 12, 2025
Merged

Simplify gas estimation flow #169

merged 2 commits into from
Jan 12, 2025

Conversation

coffeexcoin
Copy link
Collaborator

@coffeexcoin coffeexcoin commented Jan 12, 2025

  • fix: Use estimated gas from zks_estimateFee instead of calling eth_estimateGas if fee params are not provided.
  • changeset

PR-Codex overview

This PR updates the gas estimation process in the agw-client package by utilizing zks_estimateFee for gas limits instead of eth_estimateGas. This change aims to streamline gas estimation and improve efficiency in transaction preparation.

Detailed summary

  • Changed gas estimation to use zks_estimateFee instead of eth_estimateGas.
  • Added gasFromFeeEstimation variable to store gas limit from fee estimation.
  • Updated test cases to reflect new gas limit variables: MOCK_ETH_ESTIMATE_GAS_LIMIT and MOCK_ZKS_ESTIMATE_GAS_LIMIT.
  • Adjusted conditions to prevent redundant gas estimation when already provided by fee estimation.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@coffeexcoin coffeexcoin requested a review from cygaar as a code owner January 12, 2025 17:16
Copy link

changeset-bot bot commented Jan 12, 2025

🦋 Changeset detected

Latest commit: 61d2be2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@abstract-foundation/agw-client Patch
@abstract-foundation/agw-react Patch
@abstract-foundation/web3-react-agw Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
...kages/agw-client/src/actions/prepareTransaction.ts 99.23% <100.00%> (+0.03%) ⬆️

@coffeexcoin coffeexcoin merged commit d64523c into main Jan 12, 2025
6 checks passed
@coffeexcoin coffeexcoin deleted the fix/gas-estimation branch January 12, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants