This commit is contained in:
aozhiwei 2023-07-03 16:13:49 +08:00
parent e98af7e2cf
commit efcf91d7da

View File

@ -6,12 +6,14 @@ const BaseService = require('./baseservice');
class PullBcEvent extends BaseService {
async init(bc, conn, instance, cb) {
async init(bc, net, event) {
this.conn = conn;
this.instance = instance;
this.cb = cb;
this.lastBlockNumber = 0;
this.bc = bc;
this.net = net;
this.event = event;
await this.start();
}
@ -60,7 +62,9 @@ class PullBcEvent extends BaseService {
}
getInstanceName() {
return this.instance['name'];
const eventConf = this.event['eventConf'];
const instName = this.net['net_id'] + '.' + eventConf['contract_name'] + eventConf['event_name'] ;
return instName;
}
async processEvents(events, toBlock) {