This commit is contained in:
aozhiwei 2023-06-12 20:08:52 +08:00
parent 1c485745e5
commit a36d30cfc2

View File

@ -12,7 +12,6 @@ class EventProcess extends BaseService {
this.cb = cb; this.cb = cb;
this.lastBlockNumber = 0; this.lastBlockNumber = 0;
this.bc = bc; this.bc = bc;
this.netId = await this.bc.getNetId();
await this.start(); await this.start();
} }
@ -185,6 +184,7 @@ class EventProcess extends BaseService {
[ [
['txhash', event['transactionHash']], ['txhash', event['transactionHash']],
['log_index', event['logIndex']], ['log_index', event['logIndex']],
['net_id', this.bc.getNetId()],
], ],
[ [
], ],
@ -196,6 +196,7 @@ class EventProcess extends BaseService {
['block_number', event['blockNumber']], ['block_number', event['blockNumber']],
['raw_data', utils.jsonEncode(event)], ['raw_data', utils.jsonEncode(event)],
['return_values', utils.jsonEncode(returnValues)], ['return_values', utils.jsonEncode(returnValues)],
['net_id', this.bc.getNetId()],
['createtime', utils.getUtcTime()], ['createtime', utils.getUtcTime()],
['modifytime', utils.getUtcTime()], ['modifytime', utils.getUtcTime()],
] ]
@ -209,11 +210,11 @@ class EventProcess extends BaseService {
} }
getBlockNumberDbName() { getBlockNumberDbName() {
return this.instance['name'] + '.' + this.instance['eventName'] + '.last_block_number'; return this.instance['name'] + '.' + this.instance['eventName'] + '.last_block_number.' + this.bc.getNetId();
} }
getFirstBlockNumberDbName() { getFirstBlockNumberDbName() {
return this.instance['name'] + '.' + this.instance['eventName'] + '.first_block_number'; return this.instance['name'] + '.' + this.instance['eventName'] + '.first_block_number.' + this.bc.getNetId();
} }
} }