-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: migrate SwapsController to @metamask/messenger
#421
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
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
mcmire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
45c5fb5 to
4c94bcb
Compare
| _state.error.key = error.key; | ||
| _state.error.description = error.description; | ||
|
|
||
| // Partially reset state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous strategy of resetting the state one-property-at-a-time was causing a type error. The types for all properties were being combined into a single union, so then it wasn't able to ensure we were assigning a compatible type to each property.
It seemed simplest to reverse the process, and explicitly clear the properties we want, rather than clearing everything then restoring state to the properties we didn't want to clear.
|
@metamaskbot publish-previews |
|
A preview build for this branch has been published. You can configure your project to use the preview build with this identifier: See these instructions for more information about preview builds. |
cryptodev-2s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Gudahtt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR migrates
SwapsControllerto new@metamask/messengerinstead of@metamask/base-controller. This is part of a larger effort to migrate all controllers to use@metamask/messenger.Note
Migrate
SwapsControllerto the new@metamask/messenger, rename metadata flag, and bumpnetwork/gas-feecontroller peers to v25.RestrictedMessengerusage with new@metamask/messengerinSwapsController, usingthis.messengerfor action handlers, calls, and subscriptions.anonymoustoincludeInDebugSnapshotacrossmetadataand tests.stopPollingAndResetStateto partially reset state using defaults.messenger.call('NetworkController:getNetworkClientById', ...)for network lookups.SwapsControllerMessengertoMessenger<...>and related type wiring.@metamask/messengerand adjust snapshots.@metamask/gas-fee-controller^25.0.0,@metamask/network-controller^25.0.0.@metamask/messenger^0.3.0, bump@metamask/base-controllerto^9.0.0.Written by Cursor Bugbot for commit d49af03. This will update automatically on new commits. Configure here.