@@ -68,7 +68,7 @@ import {
68
68
69
69
async function handleRawEventRequest (
70
70
eventPath : string ,
71
- payload : string ,
71
+ payload : any ,
72
72
db : PgWriteStore
73
73
) : Promise < void > {
74
74
await db . storeRawEventRequest ( eventPath , payload ) ;
@@ -583,7 +583,7 @@ async function handleNewAttachmentMessage(msg: CoreNodeAttachmentMessage[], db:
583
583
}
584
584
585
585
interface EventMessageHandler {
586
- handleRawEventRequest ( eventPath : string , payload : string , db : PgWriteStore ) : Promise < void > | void ;
586
+ handleRawEventRequest ( eventPath : string , payload : any , db : PgWriteStore ) : Promise < void > | void ;
587
587
handleBlockMessage (
588
588
chainId : ChainID ,
589
589
msg : CoreNodeBlockMessage ,
@@ -607,7 +607,7 @@ function createMessageProcessorQueue(): EventMessageHandler {
607
607
// Create a promise queue so that only one message is handled at a time.
608
608
const processorQueue = new PQueue ( { concurrency : 1 } ) ;
609
609
const handler : EventMessageHandler = {
610
- handleRawEventRequest : ( eventPath : string , payload : string , db : PgWriteStore ) => {
610
+ handleRawEventRequest : ( eventPath : string , payload : any , db : PgWriteStore ) => {
611
611
return processorQueue
612
612
. add ( ( ) => handleRawEventRequest ( eventPath , payload , db ) )
613
613
. catch ( e => {
@@ -733,7 +733,7 @@ export async function startEventServer(opts: {
733
733
asyncHandler ( async ( req , res , next ) => {
734
734
const eventPath = req . path ;
735
735
let payload = JSON . stringify ( req . body ) ;
736
- await messageHandler . handleRawEventRequest ( eventPath , payload , db ) ;
736
+ await messageHandler . handleRawEventRequest ( eventPath , req . body , db ) ;
737
737
if ( logger . isDebugEnabled ( ) ) {
738
738
// Skip logging massive event payloads, this _should_ only exclude the genesis block payload which is ~80 MB.
739
739
if ( payload . length > 10_000_000 ) {
0 commit comments