From dc7741e9a8e73f39b53a53f110daaa15d6d58e6f Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 5 Feb 2018 15:37:27 -0500 Subject: [PATCH] comply with linter --- src/compiler.js | 6 +++--- src/deployer.js | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/compiler.js b/src/compiler.js index 230b8ace7f..dc74d2d1a4 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -36,10 +36,10 @@ function compileFileOrFiles (filename, isDirectory, cb) { compiler.compile(sources, filepath) } ], function (err, result) { - let errors = result.errors.filter((e) => e.type === 'Error'); + let errors = result.errors.filter((e) => e.type === 'Error') if (errors.length > 0) { - console.dir(errors); - return cb("errors compiling"); + console.dir(errors) + return cb(new Error('errors compiling')) } cb(err, result.contracts) }) diff --git a/src/deployer.js b/src/deployer.js index c8cff20e71..32dd34ba9d 100644 --- a/src/deployer.js +++ b/src/deployer.js @@ -31,7 +31,7 @@ function deployAll (compileResult, web3, callback) { compiledObject[className].filename = filename compiledObject[className].className = className - if (contractFile.indexOf("_test.sol") >=0 ) { + if (contractFile.indexOf('_test.sol') >= 0) { compiledObject[className].isTest = true } } @@ -39,22 +39,22 @@ function deployAll (compileResult, web3, callback) { next() }, function determineContractsToDeploy (next) { - let contractsToDeploy = ['Assert']; - let allContracts = Object.keys(compiledObject); + let contractsToDeploy = ['Assert'] + let allContracts = Object.keys(compiledObject) for (let contractName of allContracts) { if (contractName === 'Assert') { - continue; + continue } if (compiledObject[contractName].isTest) { contractsToDeploy.push(contractName) } } - next(null, contractsToDeploy); + next(null, contractsToDeploy) }, function deployContracts (contractsToDeploy, next) { async.eachOfLimit(contractsToDeploy, 1, function (contractName, index, nextEach) { - let contract = compiledObject[contractName]; + let contract = compiledObject[contractName] let contractObject = new web3.eth.Contract(contract.abi) let contractCode = '0x' + contract.code @@ -76,7 +76,7 @@ function deployAll (compileResult, web3, callback) { contractCode = contractCode.replace(new RegExp(toReplace, 'g'), contractObj.deployedAddress.slice(2)) } - let deployObject = contractObject.deploy({arguments: [], data: contractCode}); + let deployObject = contractObject.deploy({arguments: [], data: contractCode}) deployObject.estimateGas().then((gasValue) => { deployObject.send({ @@ -93,7 +93,6 @@ function deployAll (compileResult, web3, callback) { nextEach() }) }) - }, function () { next(null, contracts) })