Skip to content

Adds estimate gas limit for transaction batch using simulation API #5852

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

Open
wants to merge 6 commits into
base: feat/add-batch-transaction-approval-type
Choose a base branch
from

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented May 23, 2025

Explanation

This PR adds simulateGasBatch support to the Transaction Controller, enabling sequential gas estimation for nestedTransactions within a batch. When both useHook and requireApproval are true, the method simulates each transaction, calculates the total and individual gas limits, and stores the result in state for further use in the UI or execution logic.

Changes

Transaction Controller

  • Added simulateGasBatch to estimate gas for each transaction in a batch sequentially.
  • Integrated simulateGasBatch into the addTransactionBatch flow, triggered when useHook and requireApproval are true.
  • Extended state to store total and per-transaction gas limits from simulation.
  • Updated unit tests to cover batch and gas simulation logic.

References

Changelog

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@vinistevam vinistevam force-pushed the feat/add-estimate-gas-batch-transaction branch from 8154080 to 097124d Compare May 23, 2025 10:31
@vinistevam vinistevam changed the title WIP: Adds estimate gas limit for transaction batch using simulation API Adds estimate gas limit for transaction batch using simulation API May 23, 2025
@vinistevam vinistevam marked this pull request as ready for review May 23, 2025 10:48
@vinistevam vinistevam requested review from a team as code owners May 23, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant