You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Explanation
These will be used indirectly by the `UserOperationController` to
emulate adding and updating a transaction, in response to user
operations.
## References
This came up as a blocker to
MetaMask/metamask-extension#31843 because
currently the extension is directly publishing `TransactionController`
events, which will no longer be allowed with the new messenger.
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Add `emulateNewTransaction` and `emulateTransactionUpdate` actions to
TransactionController, emitting relevant swap/update events and updating
state via messenger.
>
> - **Transaction Controller**
> - **New Actions**: Add `TransactionController:emulateNewTransaction`
and `TransactionController:emulateTransactionUpdate`.
> - `emulateNewTransaction`: Publishes
`TransactionController:transactionNewSwap` or
`TransactionController:transactionNewSwapApproval` based on the
transaction type.
> - `emulateTransactionUpdate`: Sets `txParams.from` to the selected
account, adds transaction if missing, updates it, and publishes
`TransactionController:transactionStatusUpdated`.
> - **Messenger**: Register handlers for `emulateNewTransaction` and
`emulateTransactionUpdate`.
> - **Exports**: Export new action types from `src/index.ts`.
> - **Tests**: Add unit tests covering new actions, event publishing,
and state updates.
> - **Changelog**: Note added actions under Unreleased.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
357add4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
0 commit comments