Skip to content

Commit

Permalink
fixed issue with CLI and added more flattener commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloruiz55 committed Nov 16, 2018
1 parent c5fe850 commit 7deeb0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 2 additions & 7 deletions CLI/commands/common/common_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,8 @@ module.exports = {

let block = await web3.eth.getBlock("latest");
let networkGasLimit = block.gasLimit;

try {
let gas = Math.round(factor * (await action.estimateGas({ from: from.address, value: value})));
if (gas > networkGasLimit) gas = networkGasLimit;
} catch(exception) {
gas = networkGasLimit;
}
let gas = Math.round(factor * (await action.estimateGas({ from: from.address, value: value})));
if (gas > networkGasLimit) gas = networkGasLimit;

console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gas} ----`));

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"flatten-mocks": "sol-merger './contracts/mocks/*.sol' ./flat/mocks",
"flatten-oracles": "sol-merger './contracts/oracles/*.sol' ./flat/oracles",
"flatten-proxies": "sol-merger './contracts/proxy/*.sol' ./flat/proxy",
"flatten-proxyFactories": "sol-merger './contracts/modules/STO/ProxyFactory/*.sol' ./flat/modules/STO/proxy",
"flatten": "sol-merger './contracts/*.sol' ./flat",
"flatten-all": "npm run flatten-modules && npm run flatten-token && npm run flatten-mocks && npm run flatten-oracles && npm run flatten-proxies && npm run flatten",
"flatten-all": "npm run flatten-modules && npm run flatten-token && npm run flatten-mocks && npm run flatten-oracles && npm run flatten-proxies && npm run flatten && npm run flatten-proxyFactories",
"ethereum-bridge": "node_modules/.bin/ethereum-bridge -H localhost:8545 -a 9 --dev",
"st20generator": "node demo/ST20Generator",
"pretty": "prettier --write --print-width 140 --tab-width 4 \"**/*.js\""
Expand Down

0 comments on commit 7deeb0f

Please sign in to comment.