-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DNM] Preview branch of complete ComposableController
fix with no type error suppression
#10374
Closed
MajorLift
wants to merge
22
commits into
upgrade-yarn-to-v3
from
bump-composable-controller-from-3.0.0-to-8.0.0
Closed
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2508142
Pin yarn resolution for `@metamask/base-controller` to `6.0.2`
MajorLift f848a68
Remove all `@ts-{expect-error,ignore}` directives on base-controller…
MajorLift 37795b9
Fix `PPOMController` outdated base-controller version and missing `st…
MajorLift 34a9752
Bump `@metamask/assets-controllers` from `^30.0.0` to `^37.0.0` to re…
MajorLift 7e30987
Update controller state types that have been renamed
MajorLift 99072a9
Fix `TokenBalancesController:stateChange` error, add `TokenBalancesCo…
MajorLift 6487a84
Fix `name` property missing from `AssetsContractController`
MajorLift 4a2908c
Add `AccountTrackerController`, `TokenRatesController` actions/events…
MajorLift b3ff544
Fix `AddressBookController:stateChange` error by updating to new pack…
MajorLift 56e5bbc
Fix `TransactionController:stateChange` error by updating to new pack…
MajorLift 6b301ce
Fix `NftController:stateChange` error by registering to `Global{Actio…
MajorLift 4ea1202
Fix `SnapsRegistry:stateChange` error by creating yarn patch that exp…
MajorLift cc68d4a
Fix `PhishingController:stateChange` error by creating yarn patch tha…
MajorLift e5518b5
Fix `NotificationServicesController:stateChange` error by creating ya…
MajorLift 4db53e8
Fix `{Authentication,UserStorage}Controller:stateChange` error by cre…
MajorLift 3ab8991
Fix `LoggingController:stateChange` error by creating yarn patch that…
MajorLift 1601618
Consolidate comments on ComposableController events allowlist
MajorLift 36b966e
Apply core PR: "Move composable-controller utility types to base-cont…
MajorLift a9204a5
Add logic for excluding non-controllers from child controllers passed…
MajorLift 6ba9da2
Remove non-controllers from `EngineState`
MajorLift 141c010
Revert "Remove non-controllers from `EngineState`"
MajorLift 85c8af6
Exclude non-controllers from the type argument for the `ComposableCo…
MajorLift File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.yarn/patches/@metamask-logging-controller-npm-3.0.1-dc772bba77.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/dist/types/LoggingController.d.ts b/dist/types/LoggingController.d.ts | ||
index 4f00c2991dfd20a47944944eacae96c636a2accf..a8a70110d6db24dfa24324369e7f11a96f77e790 100644 | ||
--- a/dist/types/LoggingController.d.ts | ||
+++ b/dist/types/LoggingController.d.ts | ||
@@ -1,4 +1,4 @@ | ||
-import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
+import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import type { Log } from './logTypes'; | ||
/** | ||
@@ -29,12 +29,15 @@ export declare type AddLog = { | ||
type: `${typeof name}:add`; | ||
handler: LoggingController['add']; | ||
}; | ||
+export declare type LoggingControllerGetStateAction = ControllerGetStateAction<typeof name, LoggingControllerState>; | ||
/** | ||
* Currently only an alias, but the idea here is if future actions are needed | ||
* this can transition easily into a union type. | ||
*/ | ||
-export declare type LoggingControllerActions = AddLog; | ||
-export declare type LoggingControllerMessenger = RestrictedControllerMessenger<typeof name, LoggingControllerActions, never, never, never>; | ||
+export declare type LoggingControllerActions = LoggingControllerGetStateAction | AddLog; | ||
+export declare type LoggingControllerStateChangeEvent = ControllerStateChangeEvent<typeof name, LoggingControllerState>; | ||
+export declare type LoggingControllerEvents = LoggingControllerStateChangeEvent; | ||
+export declare type LoggingControllerMessenger = RestrictedControllerMessenger<typeof name, LoggingControllerActions, LoggingControllerEvents, never, never>; | ||
/** | ||
* Controller that manages a list of logs for signature requests. | ||
*/ |
21 changes: 21 additions & 0 deletions
21
.yarn/patches/@metamask-notification-services-controller-npm-0.1.1-6e91f27363.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/dist/types/NotificationServicesController/NotificationServicesController.d.ts b/dist/types/NotificationServicesController/NotificationServicesController.d.ts | ||
index 601da4f67dddf0da7d6fc00328d90ad29b6d92b3..965be3196681b666315a786dd16b46190e34950b 100644 | ||
--- a/dist/types/NotificationServicesController/NotificationServicesController.d.ts | ||
+++ b/dist/types/NotificationServicesController/NotificationServicesController.d.ts | ||
@@ -82,11 +82,13 @@ export type NotificationServicesControllerSelectIsNotificationServicesEnabled = | ||
type: `${typeof controllerName}:selectIsNotificationServicesEnabled`; | ||
handler: NotificationServicesController['selectIsNotificationServicesEnabled']; | ||
}; | ||
-export type Actions = NotificationServicesControllerUpdateMetamaskNotificationsList | NotificationServicesControllerDisableNotificationServices | NotificationServicesControllerSelectIsNotificationServicesEnabled | ControllerGetStateAction<'state', NotificationServicesControllerState>; | ||
+export type NotificationServicesControllerGetStateAction = ControllerGetStateAction<typeof controllerName, NotificationServicesControllerState>; | ||
+export type NotificationServicesControllerActions = NotificationServicesControllerGetStateAction | NotificationServicesControllerUpdateMetamaskNotificationsList | NotificationServicesControllerDisableNotificationServices | NotificationServicesControllerSelectIsNotificationServicesEnabled; | ||
export type AllowedActions = KeyringControllerGetAccountsAction | AuthenticationController.AuthenticationControllerGetBearerToken | AuthenticationController.AuthenticationControllerIsSignedIn | UserStorageController.UserStorageControllerEnableProfileSyncing | UserStorageController.UserStorageControllerGetStorageKey | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformSetStorage | NotificationServicesPushControllerEnablePushNotifications | NotificationServicesPushControllerDisablePushNotifications | NotificationServicesPushControllerUpdateTriggerPushNotifications; | ||
-export type NotificationServicesControllerMessengerEvents = ControllerStateChangeEvent<typeof controllerName, NotificationServicesControllerState>; | ||
+export type NotificationServicesControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, NotificationServicesControllerState> | ||
+export type NotificationServicesControllerEvents = NotificationServicesControllerStateChangeEvent; | ||
export type AllowedEvents = KeyringControllerStateChangeEvent | NotificationServicesPushControllerOnNewNotification; | ||
-export type NotificationServicesControllerMessenger = RestrictedControllerMessenger<typeof controllerName, Actions | AllowedActions, AllowedEvents, AllowedActions['type'], AllowedEvents['type']>; | ||
+export type NotificationServicesControllerMessenger = RestrictedControllerMessenger<typeof controllerName, NotificationServicesControllerActions | AllowedActions, NotificationServicesControllerEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>; | ||
type FeatureAnnouncementEnv = { | ||
spaceId: string; | ||
accessToken: string; |
22 changes: 22 additions & 0 deletions
22
.yarn/patches/@metamask-phishing-controller-npm-10.1.1-0005d84315.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/dist/types/PhishingController.d.ts b/dist/types/PhishingController.d.ts | ||
index 866e53b5b7bc447b2434b73a2b5a7b14dbb21145..e2624b79f8428152251196db1fd36d002f646e98 100644 | ||
--- a/dist/types/PhishingController.d.ts | ||
+++ b/dist/types/PhishingController.d.ts | ||
@@ -1,4 +1,4 @@ | ||
-import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
+import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
export declare const PHISHING_CONFIG_BASE_URL = "https://phishing-detection.api.cx.metamask.io"; | ||
export declare const METAMASK_STALELIST_FILE = "/v1/stalelist"; | ||
@@ -172,7 +172,10 @@ export type TestOrigin = { | ||
type: `${typeof controllerName}:testOrigin`; | ||
handler: PhishingController['test']; | ||
}; | ||
-export type PhishingControllerActions = MaybeUpdateState | TestOrigin; | ||
+export type PhishingControllerGetStateAction = ControllerGetStateAction<typeof controllerName, PhishingControllerState>; | ||
+export type PhishingControllerActions = PhishingControllerGetStateAction | MaybeUpdateState | TestOrigin; | ||
+export type PhishingControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, PhishingControllerState>; | ||
+export type PhishingControllerEvents = PhishingControllerStateChangeEvent; | ||
export type PhishingControllerMessenger = RestrictedControllerMessenger<typeof controllerName, PhishingControllerActions, never, never, never>; | ||
/** | ||
* Controller that manages community-maintained lists of approved and unapproved website origins. |
60 changes: 60 additions & 0 deletions
60
.yarn/patches/@metamask-profile-sync-controller-npm-0.1.3-111e75acee.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/dist/types/controllers/authentication/AuthenticationController.d.ts b/dist/types/controllers/authentication/AuthenticationController.d.ts | ||
index 03de3c60c5ce203ba45d316d42fe28827cca435c..e8634e9cc9faabec8c1190bce3980dcf46a7287f 100644 | ||
--- a/dist/types/controllers/authentication/AuthenticationController.d.ts | ||
+++ b/dist/types/controllers/authentication/AuthenticationController.d.ts | ||
@@ -1,4 +1,4 @@ | ||
-import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
+import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import type { HandleSnapRequest } from '@metamask/snaps-controllers'; | ||
import type { UserStorageControllerDisableProfileSyncing } from '../user-storage/UserStorageController'; | ||
@@ -35,14 +35,17 @@ type CreateActionsObj<Controller extends keyof AuthenticationController> = { | ||
}; | ||
}; | ||
type ActionsObj = CreateActionsObj<'performSignIn' | 'performSignOut' | 'getBearerToken' | 'getSessionProfile' | 'isSignedIn'>; | ||
-export type Actions = ActionsObj[keyof ActionsObj]; | ||
+export type AuthenticationControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AuthenticationControllerState>; | ||
+export type AuthenticationControllerActions = ActionsObj[keyof ActionsObj]; | ||
export type AuthenticationControllerPerformSignIn = ActionsObj['performSignIn']; | ||
export type AuthenticationControllerPerformSignOut = ActionsObj['performSignOut']; | ||
export type AuthenticationControllerGetBearerToken = ActionsObj['getBearerToken']; | ||
export type AuthenticationControllerGetSessionProfile = ActionsObj['getSessionProfile']; | ||
export type AuthenticationControllerIsSignedIn = ActionsObj['isSignedIn']; | ||
export type AllowedActions = HandleSnapRequest | UserStorageControllerDisableProfileSyncing; | ||
-export type AuthenticationControllerMessenger = RestrictedControllerMessenger<typeof controllerName, Actions | AllowedActions, never, AllowedActions['type'], never>; | ||
+export type AuthenticationControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AuthenticationControllerState> | ||
+export type AuthenticationControllerEvents = AuthenticationControllerStateChangeEvent; | ||
+export type AuthenticationControllerMessenger = RestrictedControllerMessenger<typeof controllerName, AuthenticationControllerGetStateAction | AllowedActions, AuthenticationControllerEvents, AllowedActions['type'], never>; | ||
/** | ||
* Controller that enables authentication for restricted endpoints. | ||
* Used for Global Profile Syncing and Notifications | ||
diff --git a/dist/types/controllers/user-storage/UserStorageController.d.ts b/dist/types/controllers/user-storage/UserStorageController.d.ts | ||
index b0e10b67c70a9e9c4ea7a5412c922b9d67cd01aa..74fb153105d798987a9cf3ec851e4cc362614da7 100644 | ||
--- a/dist/types/controllers/user-storage/UserStorageController.d.ts | ||
+++ b/dist/types/controllers/user-storage/UserStorageController.d.ts | ||
@@ -1,4 +1,4 @@ | ||
-import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
+import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import type { HandleSnapRequest } from '@metamask/snaps-controllers'; | ||
import type { AuthenticationControllerGetBearerToken, AuthenticationControllerGetSessionProfile, AuthenticationControllerIsSignedIn, AuthenticationControllerPerformSignIn, AuthenticationControllerPerformSignOut } from '../authentication/AuthenticationController'; | ||
@@ -30,14 +30,17 @@ type CreateActionsObj<Controller extends keyof UserStorageController> = { | ||
}; | ||
}; | ||
type ActionsObj = CreateActionsObj<'performGetStorage' | 'performSetStorage' | 'getStorageKey' | 'enableProfileSyncing' | 'disableProfileSyncing'>; | ||
-export type Actions = ActionsObj[keyof ActionsObj]; | ||
+export type UserStorageControllerGetStateAction = ControllerGetStateAction<typeof controllerName, UserStorageControllerState>; | ||
+export type UserStorageControllerActions = ActionsObj[keyof ActionsObj]; | ||
export type UserStorageControllerPerformGetStorage = ActionsObj['performGetStorage']; | ||
export type UserStorageControllerPerformSetStorage = ActionsObj['performSetStorage']; | ||
export type UserStorageControllerGetStorageKey = ActionsObj['getStorageKey']; | ||
export type UserStorageControllerEnableProfileSyncing = ActionsObj['enableProfileSyncing']; | ||
export type UserStorageControllerDisableProfileSyncing = ActionsObj['disableProfileSyncing']; | ||
export type AllowedActions = HandleSnapRequest | AuthenticationControllerGetBearerToken | AuthenticationControllerGetSessionProfile | AuthenticationControllerPerformSignIn | AuthenticationControllerIsSignedIn | AuthenticationControllerPerformSignOut | NotificationServicesControllerDisableNotificationServices | NotificationServicesControllerSelectIsNotificationServicesEnabled; | ||
-export type UserStorageControllerMessenger = RestrictedControllerMessenger<typeof controllerName, Actions | AllowedActions, never, AllowedActions['type'], never>; | ||
+export type UserStorageControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, UserStorageControllerState>; | ||
+export type UserStorageControllerEvents = UserStorageControllerStateChangeEvent; | ||
+export type UserStorageControllerMessenger = RestrictedControllerMessenger<typeof controllerName, UserStorageControllerActions | AllowedActions, UserStorageControllerEvents, AllowedActions['type'], never>; | ||
/** | ||
* Reusable controller that allows any team to store synchronized data for a given user. | ||
* These can be settings shared cross MetaMask clients, or data we want to persist when uninstalling/reinstalling. |
23 changes: 23 additions & 0 deletions
23
.yarn/patches/@metamask-snaps-controllers-npm-9.3.1-6a141c6563.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/dist/types/snaps/registry/json.d.ts b/dist/types/snaps/registry/json.d.ts | ||
index 4d36ce09af223f423de71b1ffff5afc285ca6c99..27a00b395ef7d1d0f13ebe6424086a07fce314ba 100644 | ||
--- a/dist/types/snaps/registry/json.d.ts | ||
+++ b/dist/types/snaps/registry/json.d.ts | ||
@@ -1,4 +1,4 @@ | ||
-import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
+import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
import type { SnapsRegistryDatabase } from '@metamask/snaps-registry'; | ||
import type { Hex } from '@metamask/utils'; | ||
@@ -32,8 +32,11 @@ export declare type Update = { | ||
type: `${typeof controllerName}:update`; | ||
handler: SnapsRegistry['update']; | ||
}; | ||
+ | ||
+export declare type SnapsRegistryGetStateAction = ControllerGetStateAction<typeof controllerName, SnapsRegistryState>; | ||
export declare type SnapsRegistryActions = GetResult | GetMetadata | Update | ResolveVersion; | ||
-export declare type SnapsRegistryEvents = never; | ||
+export declare type SnapsRegistryStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, SnapsRegistryState>; | ||
+export declare type SnapsRegistryEvents = SnapsRegistryStateChangeEvent; | ||
export declare type SnapsRegistryMessenger = RestrictedControllerMessenger<'SnapsRegistry', SnapsRegistryActions, SnapsRegistryEvents, SnapsRegistryActions['type'], SnapsRegistryEvents['type']>; | ||
export declare type SnapsRegistryState = { | ||
database: SnapsRegistryDatabase | null; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Example patch enforcing controller guidelines:
*:stateChange
event using theControllerStateChangeEvent
utility type