fix displaying menu when tx is still ongoing
This commit is contained in:
parent
af8ca0894d
commit
daf41954da
|
@ -30,7 +30,6 @@ class Provider {
|
|||
//} else {
|
||||
this.accounts.push(this.web3.eth.accounts.privateKeyToAccount('0x' + wallet.getPrivateKey().toString('hex')));
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const Spinner = require('cli-spinner').Spinner;
|
||||
|
||||
const executeAndWait = async (toSend, account) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const spinner = new Spinner('%s');
|
||||
spinner.setSpinnerString(18);
|
||||
spinner.start();
|
||||
|
@ -10,11 +11,13 @@ const executeAndWait = async (toSend, account) => {
|
|||
const receipt = await toSend.send({from: account, gas: estimatedGas + 10000});
|
||||
|
||||
spinner.stop(true);
|
||||
return receipt;
|
||||
return resolve(receipt);
|
||||
} catch(error) {
|
||||
console.log("Error: ", error.message);
|
||||
spinner.stop(true);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Reference in New Issue