Store event data in a separate column in db

This commit is contained in:
Prathamesh Musale 2024-09-18 11:40:22 +05:30
parent b69116b2bf
commit d0d6f68a21
3 changed files with 13 additions and 7 deletions

View File

@ -37,6 +37,13 @@ columns:
columnOptions:
- option: length
value: 42
- name: eventName
pgType: varchar
tsType: string
columnType: Column
columnOptions:
- option: length
value: 256
- name: topic0
pgType: varchar
tsType: string
@ -71,13 +78,10 @@ columns:
value: 66
- option: nullable
value: true
- name: eventName
- name: data
pgType: varchar
tsType: string
columnType: Column
columnOptions:
- option: length
value: 256
- name: eventInfo
pgType: text
tsType: string

View File

@ -670,7 +670,7 @@ export class Indexer {
let eventName = UNKNOWN_EVENT_NAME;
let eventInfo = {};
const tx = transactionMap[txHash];
const extraInfo: { [key: string]: any } = { topics, data, tx, logIndex };
const extraInfo: { [key: string]: any } = { tx, logIndex };
const [topic0, topic1, topic2, topic3] = topics as string[];
@ -695,11 +695,12 @@ export class Indexer {
index: this._upstreamConfig.ethServer.isFEVM ? li : logIndex,
txHash,
contract,
eventName,
topic0,
topic1,
topic2,
topic3,
eventName,
data,
eventInfo: JSONbigNative.stringify(eventInfo),
extraInfo: JSONbigNative.stringify(extraInfo),
proof: JSONbigNative.stringify({

View File

@ -61,11 +61,12 @@ export interface EventInterface {
txHash: string;
index: number;
contract: string;
eventName: string;
topic0: string;
topic1: string | null;
topic2: string | null;
topic3: string | null;
eventName: string;
data: string;
eventInfo: string;
extraInfo: string;
proof: string;