1
This commit is contained in:
parent
7a5e7980c7
commit
690ba3722a
@ -59,6 +59,10 @@ class BlockChain extends BaseService {
|
|||||||
return contract ? bcutils.toNormalAddress(contract['address']) : '';
|
return contract ? bcutils.toNormalAddress(contract['address']) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getPastEvents(contractName, eventName, ...args) {
|
||||||
|
return this.#bc[contractName + 'Instance'](eventName, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BlockChain;
|
module.exports = BlockChain;
|
||||||
|
@ -33,7 +33,8 @@ class PullBcEvent extends BaseService {
|
|||||||
const fromBlock = await this.getFromBlock();
|
const fromBlock = await this.getFromBlock();
|
||||||
const toBlock = await this.calcToBlock(fromBlock);
|
const toBlock = await this.calcToBlock(fromBlock);
|
||||||
if (toBlock > fromBlock) {
|
if (toBlock > fromBlock) {
|
||||||
const events = await this.bc[this.getInstanceName()].getPastEvents(
|
const events = await this.bc.getPastEvents(
|
||||||
|
this.getContractName(),
|
||||||
this.getEventName(),
|
this.getEventName(),
|
||||||
{
|
{
|
||||||
fromBlock: fromBlock,
|
fromBlock: fromBlock,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user