diff --git a/packages/vm/src/vm.ts b/packages/vm/src/vm.ts index 0d8e9b17ea..d0e93d2fa1 100644 --- a/packages/vm/src/vm.ts +++ b/packages/vm/src/vm.ts @@ -59,7 +59,9 @@ export class VM { * set to public due to implementation internals * @hidden */ - public readonly _emit: (topic: string, data: any) => Promise + public _emit(topic: keyof VMEvents, data: any): Promise { + return new Promise((resolve) => this.events.emit(topic, data, resolve)) + } /** * VM is run in DEBUG mode (default: false) @@ -168,10 +170,6 @@ export class VM { this._setHardfork = opts.setHardfork ?? false - this._emit = async (topic: string, data: any): Promise => { - return new Promise((resolve) => this.events.emit(topic as keyof VMEvents, data, resolve)) - } - // Skip DEBUG calls unless 'ethjs' included in environmental DEBUG variables // Additional window check is to prevent vite browser bundling (and potentially other) to break this.DEBUG =