Skip to content

feat(transaction-controller): extend isSimulationEnabled to accept optional TransactionMeta argument - #9800

Draft
matthewwalsh0 wants to merge 3 commits into
mainfrom
feat/simulation-enabled-tx-meta
Draft

feat(transaction-controller): extend isSimulationEnabled to accept optional TransactionMeta argument#9800
matthewwalsh0 wants to merge 3 commits into
mainfrom
feat/simulation-enabled-tx-meta

Conversation

@matthewwalsh0

Copy link
Copy Markdown
Member

Explanation

The isSimulationEnabled constructor option on TransactionController previously had the type () => boolean, giving consumers no visibility into which transaction triggered the check. This made it impossible to implement per-transaction simulation policies (e.g. skip simulation for certain transaction types, origins, or chain IDs).

This change updates the callback signature to (transactionMeta?: TransactionMeta) => boolean. The argument is optional so the change is backward-compatible — existing consumers that pass () => boolean continue to compile without modification. All three call sites that have a TransactionMeta in scope (#updateTransactionInternal, #updateSimulationData, #updateGasEstimate) now forward the meta; the two remaining call sites (estimateGas, estimateGasBuffered) and the batch utility pass no argument, which is valid given the optional typing.

The matching isSimulationEnabled member of AddTransactionBatchRequest in batch.ts is updated to the same signature.

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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.

1 participant