aozhiwei 29c8676ee4 1
2023-07-08 18:41:21 +08:00

41 lines
817 B
JavaScript

const log = require('j7/log');
const app = require('j7/app');
const bcutils = require('j7/bcutils');
const utils = require('j7/utils');
const j7event = require('j7/event');
const metaFactory = require('../../metadata/factory');
class BaseEventProcess {
constructor(proc, conn, eventDb) {
this.eventProc = proc;
this.conn = conn;
this.eventDb = eventDb;
this.returnValues = utils.jsonDecode(this.getEventDb());
}
genLogHead(msg) {
return this.eventProc.genLogHead(' activate721nft ' + msg);
}
getEventDb() {
return this.eventDb;
}
getBlockNumber() {
return this.eventDb['block_number'];
}
getReturnValues() {
return this.returnValues;
}
throwError(err) {
const errMsg = this.genLogHead(err);
throw errMsg;
}
}
module.exports = BaseEventProcess;