diff --git a/README.md b/README.md index 0a420e4..fb064a4 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,10 @@ In your `clevis.json` config file, change: USE_INFURA: true ``` -Create a `.env file` and add your private key under mnemonic: +Create a `.env file` and add your mnemonic: ``` -mnemonic=32h42hj34mysuperprivakeyasdasd2h34hjk234 +mnemonic="help help help help help help help help help help help help" ``` ## troubleshooting diff --git a/clevis.js b/clevis.js index 89de6b1..caf0e33 100644 --- a/clevis.js +++ b/clevis.js @@ -30,6 +30,7 @@ async function execute(name, ...args) { return result } catch(e) { winston.error(e) + return e } } diff --git a/commands/deploy.js b/commands/deploy.js index 0269512..2260287 100644 --- a/commands/deploy.js +++ b/commands/deploy.js @@ -77,8 +77,13 @@ function deploy(params,accounts,contractarguments,bytecode,abi, accountIndex) { gas: params.config.deploygas, gasPrice: params.config.gasprice }, function(error, transactionHash){ - winston.debug(`CALLBACK: ${error}\n${transactionHash}`) - checkForReceipt(2,params,transactionHash,resolve) + if (error) { + winston.debug(`CALLBACK: ${error}\n${transactionHash}`) + reject(error) + } else { + winston.debug(`CALLBACK: ${transactionHash}`) + checkForReceipt(2,params,transactionHash,resolve,reject) + } }) }) } diff --git a/utils.js b/utils.js index b50386f..40899af 100644 --- a/utils.js +++ b/utils.js @@ -1,7 +1,10 @@ const winston = require('winston') -function checkForReceipt(backoffMs, params, transactionHash, resolve) { +function checkForReceipt(backoffMs, params, transactionHash, resolve, reject) { params.web3.eth.getTransactionReceipt(transactionHash,(error,result) => { + if (error) { + reject(error) + } if(result && result.transactionHash){ winston.debug(result) resolve(result)