Skip to content

Add name and state to ExecutionService and MultichainRouter #3058

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

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ type ProtocolSnap = {
const name = 'MultichainRouter';

export class MultichainRouter {
name: typeof name = name;

state = null;

#messenger: MultichainRouterMessenger;

#withSnapKeyring: WithSnapKeyringFunction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export type TerminateJobArgs<WorkerType> = Partial<Job<WorkerType>> &
export abstract class AbstractExecutionService<WorkerType>
implements ExecutionService
{
name = 'ExecutionService' as const;

state = null;

#snapRpcHooks: Map<string, SnapRpcHook>;

// Cannot be hash private yet because of tests.
Expand Down
5 changes: 5 additions & 0 deletions packages/snaps-controllers/src/services/ExecutionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ type HandleRpcRequest = (
) => Promise<unknown>;

export interface ExecutionService {
// These fields are required for modular initialisation of the execution
// service in the MetaMask extension.
name: 'ExecutionService';
state: null;

terminateSnap: TerminateSnap;
terminateAllSnaps: TerminateAll;
executeSnap: ExecuteSnap;
Expand Down
Loading