Skip to content

Commit 1f4e9f0

Browse files
committed
Emit events before and after executing a message
1 parent 2d9cdd8 commit 1f4e9f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/evm/evm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ export default class EVM {
104104
* if an exception happens during the message execution.
105105
*/
106106
async executeMessage(message: Message): Promise<EVMResult> {
107+
await this._vm._emit('beforeMessage', message)
108+
107109
await this._state.checkpoint()
108110

109111
let result
@@ -130,6 +132,8 @@ export default class EVM {
130132
await this._state.commit()
131133
}
132134

135+
await this._vm._emit('afterMessage', result)
136+
133137
return result
134138
}
135139

0 commit comments

Comments
 (0)