Skip to content

Commit

Permalink
Fix composable-controller allowlist error by assigning messenger to i…
Browse files Browse the repository at this point in the history
…ts own variable

See MetaMask/core#4033
  • Loading branch information
MajorLift committed Jun 15, 2024
1 parent 2e9a554 commit 3fd34e5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1354,12 +1354,8 @@ class Engine {
}
}

this.datamodel = new ComposableController<
EngineState,
Controllers[keyof Controllers]
>({
controllers,
messenger: this.controllerMessenger.getRestricted({
const composableControllerMessenger =
this.controllerMessenger.getRestricted({
name: 'ComposableController',
allowedActions: [],
// Add `stateChange` event here and in the `GlobalEvents` type
Expand All @@ -1385,7 +1381,13 @@ class Engine {
'SnapController:stateChange',
'SubjectMetadataController:stateChange',
],
}),
});
this.datamodel = new ComposableController<
EngineState,
Controllers[keyof Controllers]

Check failure on line 1387 in app/core/Engine.ts

View workflow job for this annotation

GitHub Actions / scripts (lint:tsc)

Type 'KeyringController | CurrencyRateController | NetworkController | TransactionController | ... 22 more ... | SwapsController' does not satisfy the constraint 'ControllerInstance'.
>({
controllers,
messenger: composableControllerMessenger,
});
this.context = controllers.reduce<Partial<typeof this.context>>(
(context, controller) => ({
Expand Down

0 comments on commit 3fd34e5

Please sign in to comment.