This commit is contained in:
aozhiwei 2022-03-29 20:44:44 +08:00
parent e9bbb912b3
commit adebc6dbdc
2 changed files with 18 additions and 3 deletions

View File

@ -21,6 +21,7 @@ class TransferMgr {
init() {
setTimeout(this.start.bind(this), 1000 * 0.1);
setTimeout(this.fetchEvent.bind(this), 1000 * 3);
}
async start() {
@ -102,6 +103,16 @@ class TransferMgr {
delete this.pendingWithdrawalHash[withdrawalId];
}
async fetchEvent() {
return;
bc['ceg_coinInstance'].getPastEvents(
'Transfer',
{
}
)
}
}
module.exports = new TransferMgr();

View File

@ -35,9 +35,13 @@ class Withdrawal {
]);
const instance = bc[instanceName];
const balance = await instance.methods.balanceOf(metamgr.getUserAddress()).call();
console.log('balance:' + balance);
const receipt = instance.methods.transfer(this.db['account'], this.db['amount']).call();
console.log(receipt);
log.info('balance:' + balance);
await bc.lock();
try {
const receipt = await instance.methods.transfer('0xAd2DeA1977055Db01C66e6E53309C4604AB869b8', amount).send({gas: 1000000});
} finally {
await bc.unLock();
}
}
getInstanceName() {