fix displaying menu when tx is still ongoing

This commit is contained in:
Iuri Matias 2019-05-23 14:42:40 -04:00
parent af8ca0894d
commit daf41954da
3 changed files with 19 additions and 17 deletions

View File

@ -30,7 +30,6 @@ class Provider {
//} else {
this.accounts.push(this.web3.eth.accounts.privateKeyToAccount('0x' + wallet.getPrivateKey().toString('hex')));
//}
}
}
}

View File

@ -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 = {