1
This commit is contained in:
parent
e9bbb912b3
commit
adebc6dbdc
@ -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();
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user