diff --git a/packages/core/src/deploy.ts b/packages/core/src/deploy.ts index 8b5a47730..da4509e26 100644 --- a/packages/core/src/deploy.ts +++ b/packages/core/src/deploy.ts @@ -59,7 +59,7 @@ export async function deploy< defaultSender?: string; }): Promise> { if (executionEventListener !== undefined) { - executionEventListener.SET_MODULE_ID({ + executionEventListener.setModuleId({ type: ExecutionEventType.SET_MODULE_ID, moduleName: ignitionModule.id, }); @@ -72,7 +72,7 @@ export async function deploy< if (validationResult !== null) { if (executionEventListener !== undefined) { - executionEventListener.DEPLOYMENT_COMPLETE({ + executionEventListener.deploymentComplete({ type: ExecutionEventType.DEPLOYMENT_COMPLETE, result: validationResult, }); diff --git a/packages/core/src/internal/deployer.ts b/packages/core/src/internal/deployer.ts index 2a95e91c4..36d0307c4 100644 --- a/packages/core/src/internal/deployer.ts +++ b/packages/core/src/internal/deployer.ts @@ -244,7 +244,7 @@ export class Deployer { return; } - this._executionEventListener.DEPLOYMENT_START({ + this._executionEventListener.deploymentStart({ type: ExecutionEventType.DEPLOYMENT_START, moduleName: moduleId, }); @@ -255,7 +255,7 @@ export class Deployer { return; } - this._executionEventListener.BATCH_INITIALIZE({ + this._executionEventListener.batchInitialize({ type: ExecutionEventType.BATCH_INITIALIZE, batches, }); @@ -268,7 +268,7 @@ export class Deployer { return; } - this._executionEventListener.DEPLOYMENT_COMPLETE({ + this._executionEventListener.deploymentComplete({ type: ExecutionEventType.DEPLOYMENT_COMPLETE, result, }); diff --git a/packages/core/src/internal/execution/execution-engine.ts b/packages/core/src/internal/execution/execution-engine.ts index 4bfd26378..0b0496d25 100644 --- a/packages/core/src/internal/execution/execution-engine.ts +++ b/packages/core/src/internal/execution/execution-engine.ts @@ -271,7 +271,7 @@ export class ExecutionEngine { */ private _emitBeginNextBatchEvent(): void { if (this._executionEventListener !== undefined) { - this._executionEventListener.BEGIN_NEXT_BATCH({ + this._executionEventListener.beginNextBatch({ type: ExecutionEventType.BEGIN_NEXT_BATCH, }); } diff --git a/packages/core/src/internal/journal/utils/emitExecutionEvent.ts b/packages/core/src/internal/journal/utils/emitExecutionEvent.ts index 74f21b370..82e85a1a3 100644 --- a/packages/core/src/internal/journal/utils/emitExecutionEvent.ts +++ b/packages/core/src/internal/journal/utils/emitExecutionEvent.ts @@ -27,32 +27,28 @@ export function emitExecutionEvent( ): void { switch (message.type) { case JournalMessageType.RUN_START: { - executionEventListener[ExecutionEventType.RUN_START]({ + executionEventListener.runStart({ type: ExecutionEventType.RUN_START, chainId: message.chainId, }); break; } case JournalMessageType.WIPE_EXECUTION_STATE: { - executionEventListener[ExecutionEventType.WIPE_EXECUTION_STATE]({ + executionEventListener.wipeExecutionState({ type: ExecutionEventType.WIPE_EXECUTION_STATE, futureId: message.futureId, }); break; } case JournalMessageType.DEPLOYMENT_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.deploymentExecutionStateInitialize({ type: ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, }); break; } case JournalMessageType.DEPLOYMENT_EXECUTION_STATE_COMPLETE: { - executionEventListener[ - ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_COMPLETE - ]({ + executionEventListener.deploymentExecutionStateComplete({ type: ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_COMPLETE, futureId: message.futureId, result: convertExecutionResultToEventResult(message.result), @@ -60,16 +56,14 @@ export function emitExecutionEvent( break; } case JournalMessageType.CALL_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.CALL_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.callExecutionStateInitialize({ type: ExecutionEventType.CALL_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, }); break; } case JournalMessageType.CALL_EXECUTION_STATE_COMPLETE: { - executionEventListener[ExecutionEventType.CALL_EXECUTION_STATE_COMPLETE]({ + executionEventListener.callExecutionStateComplete({ type: ExecutionEventType.CALL_EXECUTION_STATE_COMPLETE, futureId: message.futureId, result: convertExecutionResultToEventResult(message.result), @@ -77,18 +71,14 @@ export function emitExecutionEvent( break; } case JournalMessageType.STATIC_CALL_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.STATIC_CALL_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.staticCallExecutionStateInitialize({ type: ExecutionEventType.STATIC_CALL_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, }); break; } case JournalMessageType.STATIC_CALL_EXECUTION_STATE_COMPLETE: { - executionEventListener[ - ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE - ]({ + executionEventListener.staticCallExecutionStateComplete({ type: ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE, futureId: message.futureId, result: convertStaticCallResultToExecutionEventResult(message.result), @@ -96,37 +86,29 @@ export function emitExecutionEvent( break; } case JournalMessageType.SEND_DATA_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.SEND_DATA_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.sendDataExecutionStateInitialize({ type: ExecutionEventType.SEND_DATA_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, }); break; } case JournalMessageType.SEND_DATA_EXECUTION_STATE_COMPLETE: { - executionEventListener[ - ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE - ]({ - type: ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE, + executionEventListener.sendDataExecutionStateComplete({ + type: ExecutionEventType.SEND_DATA_EXECUTION_STATE_COMPLETE, futureId: message.futureId, result: convertExecutionResultToEventResult(message.result), }); break; } case JournalMessageType.CONTRACT_AT_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.CONTRACT_AT_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.contractAtExecutionStateInitialize({ type: ExecutionEventType.CONTRACT_AT_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, }); break; } case JournalMessageType.READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE: { - executionEventListener[ - ExecutionEventType.READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE - ]({ + executionEventListener.readEventArgumentExecutionStateInitialize({ type: ExecutionEventType.READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE, futureId: message.futureId, result: { @@ -137,7 +119,7 @@ export function emitExecutionEvent( break; } case JournalMessageType.NETWORK_INTERACTION_REQUEST: { - executionEventListener[ExecutionEventType.NETWORK_INTERACTION_REQUEST]({ + executionEventListener.networkInteractionRequest({ type: ExecutionEventType.NETWORK_INTERACTION_REQUEST, networkInteractionType: message.networkInteraction.type === @@ -149,7 +131,7 @@ export function emitExecutionEvent( break; } case JournalMessageType.TRANSACTION_SEND: { - executionEventListener[ExecutionEventType.TRANSACTION_SEND]({ + executionEventListener.transactionSend({ type: ExecutionEventType.TRANSACTION_SEND, futureId: message.futureId, hash: message.transaction.hash, @@ -157,7 +139,7 @@ export function emitExecutionEvent( break; } case JournalMessageType.TRANSACTION_CONFIRM: { - executionEventListener[ExecutionEventType.TRANSACTION_CONFIRM]({ + executionEventListener.transactionConfirm({ type: ExecutionEventType.TRANSACTION_CONFIRM, futureId: message.futureId, hash: message.hash, @@ -165,37 +147,35 @@ export function emitExecutionEvent( break; } case JournalMessageType.STATIC_CALL_COMPLETE: { - executionEventListener[ExecutionEventType.STATIC_CALL_COMPLETE]({ + executionEventListener.staticCallComplete({ type: ExecutionEventType.STATIC_CALL_COMPLETE, futureId: message.futureId, }); break; } case JournalMessageType.ONCHAIN_INTERACTION_BUMP_FEES: { - executionEventListener[ExecutionEventType.ONCHAIN_INTERACTION_BUMP_FEES]({ + executionEventListener.onchainInteractionBumpFees({ type: ExecutionEventType.ONCHAIN_INTERACTION_BUMP_FEES, futureId: message.futureId, }); break; } case JournalMessageType.ONCHAIN_INTERACTION_DROPPED: { - executionEventListener[ExecutionEventType.ONCHAIN_INTERACTION_DROPPED]({ + executionEventListener.onchainInteractionDropped({ type: ExecutionEventType.ONCHAIN_INTERACTION_DROPPED, futureId: message.futureId, }); break; } case JournalMessageType.ONCHAIN_INTERACTION_REPLACED_BY_USER: { - executionEventListener[ - ExecutionEventType.ONCHAIN_INTERACTION_REPLACED_BY_USER - ]({ + executionEventListener.onchainInteractionReplacedByUser({ type: ExecutionEventType.ONCHAIN_INTERACTION_REPLACED_BY_USER, futureId: message.futureId, }); break; } case JournalMessageType.ONCHAIN_INTERACTION_TIMEOUT: { - executionEventListener[ExecutionEventType.ONCHAIN_INTERACTION_TIMEOUT]({ + executionEventListener.onchainInteractionTimeout({ type: ExecutionEventType.ONCHAIN_INTERACTION_TIMEOUT, futureId: message.futureId, }); diff --git a/packages/core/src/types/execution-events.ts b/packages/core/src/types/execution-events.ts index f08f62b35..a4956c1b2 100644 --- a/packages/core/src/types/execution-events.ts +++ b/packages/core/src/types/execution-events.ts @@ -422,13 +422,23 @@ export interface ExecutionEventTypeMap { [ExecutionEventType.SET_MODULE_ID]: SetModuleIdEvent; } +/** + * A utility type for mapping enum values to function names + * + * @beta + */ +export type SnakeToCamelCase = + S extends `${infer T}_${infer U}` + ? `${Lowercase}${Capitalize>>}` + : S; + /** * A listener for execution events. * * @beta */ export type ExecutionEventListener = { - [eventType in ExecutionEventType]: ( + [eventType in ExecutionEventType as SnakeToCamelCase]: ( event: ExecutionEventTypeMap[eventType] ) => void; }; diff --git a/packages/hardhat-plugin/src/ui/UiEventHandler.tsx b/packages/hardhat-plugin/src/ui/UiEventHandler.tsx index 8fef64161..12b12cc7d 100644 --- a/packages/hardhat-plugin/src/ui/UiEventHandler.tsx +++ b/packages/hardhat-plugin/src/ui/UiEventHandler.tsx @@ -14,7 +14,6 @@ import { ExecutionEventListener, ExecutionEventResult, ExecutionEventResultType, - ExecutionEventType, IgnitionError, IgnitionModuleResult, NetworkInteractionRequestEvent, @@ -82,16 +81,14 @@ export class UiEventHandler implements ExecutionEventListener { this._renderToCli(); } - public [ExecutionEventType.RUN_START](event: RunStartEvent): void { + public runStart(event: RunStartEvent): void { this.state = { ...this.state, chainId: event.chainId, }; } - public [ExecutionEventType.WIPE_EXECUTION_STATE]( - event: WipeExecutionStateEvent - ): void { + public wipeExecutionState(event: WipeExecutionStateEvent): void { const batches: UiBatches = []; for (const batch of this.state.batches) { @@ -114,7 +111,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_INITIALIZE]( + public deploymentExecutionStateInitialize( event: DeploymentExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -130,7 +127,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_COMPLETE]( + public deploymentExecutionStateComplete( event: DeploymentExecutionStateCompleteEvent ): void { const updatedFuture: UiFuture = { @@ -144,7 +141,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.CALL_EXECUTION_STATE_INITIALIZE]( + public callExecutionStateInitialize( event: CallExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -160,7 +157,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.CALL_EXECUTION_STATE_COMPLETE]( + public callExecutionStateComplete( event: CallExecutionStateCompleteEvent ): void { const updatedFuture: UiFuture = { @@ -174,7 +171,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.STATIC_CALL_EXECUTION_STATE_INITIALIZE]( + public staticCallExecutionStateInitialize( event: StaticCallExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -190,7 +187,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE]( + public staticCallExecutionStateComplete( event: StaticCallExecutionStateCompleteEvent ): void { const updatedFuture: UiFuture = { @@ -204,7 +201,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.SEND_DATA_EXECUTION_STATE_INITIALIZE]( + public sendDataExecutionStateInitialize( event: SendDataExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -220,7 +217,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.SEND_DATA_EXECUTION_STATE_COMPLETE]( + public sendDataExecutionStateComplete( event: SendDataExecutionStateCompleteEvent ): void { const updatedFuture: UiFuture = { @@ -234,7 +231,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.CONTRACT_AT_EXECUTION_STATE_INITIALIZE]( + public contractAtExecutionStateInitialize( event: ContractAtExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -250,7 +247,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE]( + public readEventArgumentExecutionStateInitialize( event: ReadEventArgExecutionStateInitializeEvent ): void { const updatedFuture: UiFuture = { @@ -266,9 +263,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.BATCH_INITIALIZE]( - event: BatchInitializeEvent - ): void { + public batchInitialize(event: BatchInitializeEvent): void { const batches: UiBatches = []; for (const batch of event.batches) { @@ -292,41 +287,33 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.NETWORK_INTERACTION_REQUEST]( + public networkInteractionRequest( _event: NetworkInteractionRequestEvent ): void {} - public [ExecutionEventType.TRANSACTION_SEND]( - _event: TransactionSendEvent - ): void {} + public transactionSend(_event: TransactionSendEvent): void {} - public [ExecutionEventType.TRANSACTION_CONFIRM]( - _event: TransactionConfirmEvent - ): void {} + public transactionConfirm(_event: TransactionConfirmEvent): void {} - public [ExecutionEventType.STATIC_CALL_COMPLETE]( - _event: StaticCallCompleteEvent - ): void {} + public staticCallComplete(_event: StaticCallCompleteEvent): void {} - public [ExecutionEventType.ONCHAIN_INTERACTION_BUMP_FEES]( + public onchainInteractionBumpFees( _event: OnchainInteractionBumpFeesEvent ): void {} - public [ExecutionEventType.ONCHAIN_INTERACTION_DROPPED]( + public onchainInteractionDropped( _event: OnchainInteractionDroppedEvent ): void {} - public [ExecutionEventType.ONCHAIN_INTERACTION_REPLACED_BY_USER]( + public onchainInteractionReplacedByUser( _event: OnchainInteractionReplacedByUserEvent ): void {} - public [ExecutionEventType.ONCHAIN_INTERACTION_TIMEOUT]( + public onchainInteractionTimeout( _event: OnchainInteractionTimeoutEvent ): void {} - public [ExecutionEventType.DEPLOYMENT_START]( - event: DeploymentStartEvent - ): void { + public deploymentStart(event: DeploymentStartEvent): void { this.state = { ...this.state, status: UiStateDeploymentStatus.DEPLOYING, @@ -334,13 +321,9 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.BEGIN_NEXT_BATCH]( - _event: BeginNextBatchEvent - ): void {} + public beginNextBatch(_event: BeginNextBatchEvent): void {} - public [ExecutionEventType.DEPLOYMENT_COMPLETE]( - event: DeploymentCompleteEvent - ): void { + public deploymentComplete(event: DeploymentCompleteEvent): void { this.state = { ...this.state, status: UiStateDeploymentStatus.COMPLETE, @@ -349,7 +332,7 @@ export class UiEventHandler implements ExecutionEventListener { }; } - public [ExecutionEventType.SET_MODULE_ID](event: SetModuleIdEvent): void { + public setModuleId(event: SetModuleIdEvent): void { this.state = { ...this.state, moduleName: event.moduleName, diff --git a/packages/hardhat-plugin/src/ui/VerboseEventHandler.ts b/packages/hardhat-plugin/src/ui/VerboseEventHandler.ts index f6173aa8a..01709e021 100644 --- a/packages/hardhat-plugin/src/ui/VerboseEventHandler.ts +++ b/packages/hardhat-plugin/src/ui/VerboseEventHandler.ts @@ -11,7 +11,6 @@ import { ExecutionEventListener, ExecutionEventNetworkInteractionType, ExecutionEventResultType, - ExecutionEventType, NetworkInteractionRequestEvent, OnchainInteractionBumpFeesEvent, OnchainInteractionDroppedEvent, @@ -31,23 +30,21 @@ import { } from "@ignored/ignition-core"; export class VerboseEventHandler implements ExecutionEventListener { - public [ExecutionEventType.RUN_START](event: RunStartEvent): void { + public runStart(event: RunStartEvent): void { console.log(`Deployment started for chainId: ${event.chainId}`); } - public [ExecutionEventType.WIPE_EXECUTION_STATE]( - event: WipeExecutionStateEvent - ): void { + public wipeExecutionState(event: WipeExecutionStateEvent): void { console.log(`Removing the execution of future ${event.futureId}`); } - public [ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_INITIALIZE]( + public deploymentExecutionStateInitialize( event: DeploymentExecutionStateInitializeEvent ): void { console.log(`Starting to execute the deployment future ${event.futureId}`); } - public [ExecutionEventType.DEPLOYMENT_EXECUTION_STATE_COMPLETE]( + public deploymentExecutionStateComplete( event: DeploymentExecutionStateCompleteEvent ): void { if (event.result.type === ExecutionEventResultType.SUCCESS) { @@ -63,13 +60,13 @@ export class VerboseEventHandler implements ExecutionEventListener { } } - public [ExecutionEventType.CALL_EXECUTION_STATE_INITIALIZE]( + public callExecutionStateInitialize( event: CallExecutionStateInitializeEvent ): void { console.log(`Starting to execute the call future ${event.futureId}`); } - public [ExecutionEventType.CALL_EXECUTION_STATE_COMPLETE]( + public callExecutionStateComplete( event: CallExecutionStateCompleteEvent ): void { if (event.result.type === ExecutionEventResultType.SUCCESS) { @@ -83,13 +80,13 @@ export class VerboseEventHandler implements ExecutionEventListener { } } - public [ExecutionEventType.STATIC_CALL_EXECUTION_STATE_INITIALIZE]( + public staticCallExecutionStateInitialize( event: StaticCallExecutionStateInitializeEvent ): void { console.log(`Starting to execute the static call future ${event.futureId}`); } - public [ExecutionEventType.STATIC_CALL_EXECUTION_STATE_COMPLETE]( + public staticCallExecutionStateComplete( event: StaticCallExecutionStateCompleteEvent ): void { if (event.result.type === ExecutionEventResultType.SUCCESS) { @@ -105,13 +102,13 @@ export class VerboseEventHandler implements ExecutionEventListener { } } - public [ExecutionEventType.SEND_DATA_EXECUTION_STATE_INITIALIZE]( + public sendDataExecutionStateInitialize( event: SendDataExecutionStateInitializeEvent ): void { console.log(`Started to execute the send data future ${event.futureId}`); } - public [ExecutionEventType.SEND_DATA_EXECUTION_STATE_COMPLETE]( + public sendDataExecutionStateComplete( event: SendDataExecutionStateCompleteEvent ): void { if (event.result.type === ExecutionEventResultType.SUCCESS) { @@ -127,13 +124,13 @@ export class VerboseEventHandler implements ExecutionEventListener { } } - public [ExecutionEventType.CONTRACT_AT_EXECUTION_STATE_INITIALIZE]( + public contractAtExecutionStateInitialize( event: ContractAtExecutionStateInitializeEvent ): void { console.log(`Executed contract at future ${event.futureId}`); } - public [ExecutionEventType.READ_EVENT_ARGUMENT_EXECUTION_STATE_INITIALIZE]( + public readEventArgumentExecutionStateInitialize( event: ReadEventArgExecutionStateInitializeEvent ): void { console.log( @@ -143,7 +140,7 @@ export class VerboseEventHandler implements ExecutionEventListener { ); } - public [ExecutionEventType.NETWORK_INTERACTION_REQUEST]( + public networkInteractionRequest( event: NetworkInteractionRequestEvent ): void { if ( @@ -158,27 +155,21 @@ export class VerboseEventHandler implements ExecutionEventListener { } } - public [ExecutionEventType.TRANSACTION_SEND]( - event: TransactionSendEvent - ): void { + public transactionSend(event: TransactionSendEvent): void { console.log( `Transaction ${event.hash} sent for onchain interaction of future ${event.futureId}` ); } - public [ExecutionEventType.TRANSACTION_CONFIRM]( - event: TransactionConfirmEvent - ): void { + public transactionConfirm(event: TransactionConfirmEvent): void { console.log(`Transaction ${event.hash} confirmed`); } - public [ExecutionEventType.STATIC_CALL_COMPLETE]( - event: StaticCallCompleteEvent - ): void { + public staticCallComplete(event: StaticCallCompleteEvent): void { console.log(`Static call completed for future ${event.futureId}`); } - public [ExecutionEventType.ONCHAIN_INTERACTION_BUMP_FEES]( + public onchainInteractionBumpFees( event: OnchainInteractionBumpFeesEvent ): void { console.log( @@ -186,7 +177,7 @@ export class VerboseEventHandler implements ExecutionEventListener { ); } - public [ExecutionEventType.ONCHAIN_INTERACTION_DROPPED]( + public onchainInteractionDropped( event: OnchainInteractionDroppedEvent ): void { console.log( @@ -194,7 +185,7 @@ export class VerboseEventHandler implements ExecutionEventListener { ); } - public [ExecutionEventType.ONCHAIN_INTERACTION_REPLACED_BY_USER]( + public onchainInteractionReplacedByUser( event: OnchainInteractionReplacedByUserEvent ): void { console.log( @@ -202,7 +193,7 @@ export class VerboseEventHandler implements ExecutionEventListener { ); } - public [ExecutionEventType.ONCHAIN_INTERACTION_TIMEOUT]( + public onchainInteractionTimeout( event: OnchainInteractionTimeoutEvent ): void { console.log( @@ -210,33 +201,25 @@ export class VerboseEventHandler implements ExecutionEventListener { ); } - public [ExecutionEventType.BATCH_INITIALIZE]( - event: BatchInitializeEvent - ): void { + public batchInitialize(event: BatchInitializeEvent): void { console.log( `Starting execution for batches: ${JSON.stringify(event.batches)}` ); } - public [ExecutionEventType.DEPLOYMENT_START]( - _event: DeploymentStartEvent - ): void { + public deploymentStart(_event: DeploymentStartEvent): void { console.log(`Starting execution for new deployment`); } - public [ExecutionEventType.BEGIN_NEXT_BATCH]( - _event: BeginNextBatchEvent - ): void { + public beginNextBatch(_event: BeginNextBatchEvent): void { console.log(`Starting execution for next batch`); } - public [ExecutionEventType.DEPLOYMENT_COMPLETE]( - _event: DeploymentCompleteEvent - ): void { + public deploymentComplete(_event: DeploymentCompleteEvent): void { console.log(`Deployment complete`); } - public [ExecutionEventType.SET_MODULE_ID](event: SetModuleIdEvent): void { + public setModuleId(event: SetModuleIdEvent): void { console.log(`Starting validation for module: ${event.moduleName}`); } }