Skip to content

Commit 1a1ec5e

Browse files
authored
Add name and state to ExecutionService and MultichainRouter (#3058)
This adds a `name` and `state` field to the `ExecutionService` and `MultichainRouter`, which is required for it to work with modular initialisation in the MetaMask extension.
1 parent 361cd5b commit 1a1ec5e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

packages/snaps-controllers/src/multichain/MultichainRouter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ type ProtocolSnap = {
114114
const name = 'MultichainRouter';
115115

116116
export class MultichainRouter {
117+
name: typeof name = name;
118+
119+
state = null;
120+
117121
#messenger: MultichainRouterMessenger;
118122

119123
#withSnapKeyring: WithSnapKeyringFunction;

packages/snaps-controllers/src/services/AbstractExecutionService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export type TerminateJobArgs<WorkerType> = Partial<Job<WorkerType>> &
6464
export abstract class AbstractExecutionService<WorkerType>
6565
implements ExecutionService
6666
{
67+
name: typeof controllerName = controllerName;
68+
69+
state = null;
70+
6771
#snapRpcHooks: Map<string, SnapRpcHook>;
6872

6973
// Cannot be hash private yet because of tests.

packages/snaps-controllers/src/services/ExecutionService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ type HandleRpcRequest = (
1212
) => Promise<unknown>;
1313

1414
export interface ExecutionService {
15+
// These fields are required for modular initialisation of the execution
16+
// service in the MetaMask extension.
17+
name: 'ExecutionService';
18+
state: null;
19+
1520
terminateSnap: TerminateSnap;
1621
terminateAllSnaps: TerminateAll;
1722
executeSnap: ExecuteSnap;

0 commit comments

Comments
 (0)