mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-07-28 11:02:07 +00:00
Store event data in a separate column in db
This commit is contained in:
parent
b69116b2bf
commit
d0d6f68a21
@ -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
|
||||
|
@ -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({
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user