@@ -111,7 +111,8 @@ async function decodeTransaction(
111
111
}
112
112
113
113
function extractEvents (
114
- runtimeResult : RuntimeContextReducedExecutionResult
114
+ runtimeResult : RuntimeContextReducedExecutionResult ,
115
+ source : string
115
116
) : { eventName : string ; data : Field [ ] } [ ] {
116
117
return runtimeResult . events . reduce (
117
118
( acc , event ) => {
@@ -120,13 +121,14 @@ function extractEvents(
120
121
eventName : event . eventName ,
121
122
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
122
123
data : event . eventType . toFields ( event . event ) ,
124
+ source : source ,
123
125
} ;
124
126
acc . push ( obj ) ;
125
127
}
126
128
return acc ;
127
129
} ,
128
130
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
129
- [ ] as { eventName : string ; data : Field [ ] } [ ]
131
+ [ ] as { eventName : string ; data : Field [ ] ; source : string } [ ]
130
132
) ;
131
133
}
132
134
@@ -314,7 +316,7 @@ export class TransactionExecutionService {
314
316
async ( hook , hookArgs ) => await hook . beforeTransaction ( hookArgs ) ,
315
317
"beforeTx"
316
318
) ;
317
- const beforeHookEvents = extractEvents ( beforeTxHookResult ) ;
319
+ const beforeHookEvents = extractEvents ( beforeTxHookResult , "beforeTxHook" ) ;
318
320
319
321
await recordingStateService . applyStateTransitions (
320
322
beforeTxHookResult . stateTransitions
@@ -364,7 +366,7 @@ export class TransactionExecutionService {
364
366
async ( hook , hookArgs ) => await hook . afterTransaction ( hookArgs ) ,
365
367
"afterTx"
366
368
) ;
367
- const afterHookEvents = extractEvents ( afterTxHookResult ) ;
369
+ const afterHookEvents = extractEvents ( afterTxHookResult , "afterTxHook" ) ;
368
370
await recordingStateService . applyStateTransitions (
369
371
afterTxHookResult . stateTransitions
370
372
) ;
@@ -378,7 +380,7 @@ export class TransactionExecutionService {
378
380
appChain . setProofsEnabled ( previousProofsEnabled ) ;
379
381
380
382
// Extract sequencing results
381
- const runtimeResultEvents = extractEvents ( runtimeResult ) ;
383
+ const runtimeResultEvents = extractEvents ( runtimeResult , "runtime" ) ;
382
384
const stateTransitions = this . buildSTBatches (
383
385
[
384
386
beforeTxHookResult . stateTransitions ,
0 commit comments