Simplifying code

This commit is contained in:
Richard Ramos 2018-08-23 15:58:09 -04:00
parent aa63705638
commit c6b3c226c4
2 changed files with 6 additions and 8 deletions

View File

@ -54,21 +54,21 @@ class ContractSettings {
return this.web3.utils.toHex(contractName).slice(0, 10);
}
_obtainContractBytecode(topicName){
async _obtainContractBytecode(topicName){
if(this.contracts[topicName].isIdentity) return;
this.pendingToLoad++;
this.web3.eth.getCode(this.contracts[topicName].address)
.then(code => {
try {
const code = await this.web3.eth.getCode(this.contracts[topicName].address)
this.contracts[topicName].code = this.web3.utils.soliditySha3(code);
this.pendingToLoad--;
if(this.pendingToLoad == 0) this.events.emit("setup:complete", this);
})
.catch((err) => {
} catch(err) {
console.error("Invalid contract for " + topicName);
console.error(err);
process.exit();
});
}
}
_extractFunctions(topicName){

View File

@ -29,8 +29,6 @@ class BaseStrategy {
}
async _estimateGas(input){
console.dir(input);
let p = {
from: this.config.node.blockchain.account,
to: input.contract,