-
Notifications
You must be signed in to change notification settings - Fork 630
refactor: base controller migration #3611
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
293ddb4 to
88d1ae4
Compare
c4e0f41 to
d22006d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3611 +/- ##
==========================================
- Coverage 98.29% 98.28% -0.02%
==========================================
Files 417 418 +1
Lines 11925 12152 +227
Branches 1851 1876 +25
==========================================
+ Hits 11722 11943 +221
- Misses 203 209 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fea5048 to
e3e359b
Compare
|
@metamaskbot publish-previews |
1 similar comment
|
@metamaskbot publish-previews |
6992e4e to
6ccfe09
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| export type RootControllerAllowedEvents = | ||
| SnapInterfaceControllerStateChangeEvent; | ||
|
|
||
| export type RootControllerMessenger = Messenger< |
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.
This is odd. What is this type used for?
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.
It is meant as a type for https://github.com/MetaMask/snaps/blob/fb/base-controller-migration/packages/snaps-simulation/src/simulation.ts#L362 which we pass around to be used in the snaps-jest framework.
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.
May have been written before we had MockAnyNamespace
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.
Ah OK. I was asking because we introduced another use of any here, which our guidelines generally forbid the use of.
We should be able to get rid of all of the any instances we've introduced here, but we can figure that out later. It would also be nice to get rid of this export if we don't need it anymore.
Closes #3315.
Note
Replaces RestrictedMessenger with @metamask/messenger across packages, renames metadata flag, and updates deps/tests and controller wiring with breaking API changes.
RestrictedMessengerwith@metamask/messengerMessengeracrosssnaps-controllers,snaps-rpc-methods,snaps-simulation, andsnaps-utils.anonymoustoincludeInDebugSnapshotin controllers; update persistence and debug snapshot handling.messagingSystem.*calls tomessenger.*(subscribe,unsubscribe,registerActionHandler,call,publish).CronjobControllerMessenger,SnapInsightsControllerMessenger,SnapInterfaceControllerMessenger,MultichainRouterMessenger,ExecutionServiceMessenger,WebSocketServiceMessenger).snaps-rpc-methods:handleSnapInstallnow takesmessenger(wasmessagingSystem).WithSnapKeyringFunctionfromMultichainRouter.@metamask/approval-controller→^8.0.0,@metamask/base-controller→^9.0.0,@metamask/permission-controller→^12.0.0; add@metamask/messengerwhere needed; remove@metamask/base-controllerin some packages.Messengerdelegation; adapt expectations fromrootMessenger.calltocontrollerMessenger.call.PhishingDetectorResultType), add JSON-RPCid/jsonrpcfields, and origin constants.deriveStateFromMetadata, WebSocket mock fixes).Written by Cursor Bugbot for commit b53fe57. This will update automatically on new commits. Configure here.