Commit dc7741e9 authored by Iuri Matias's avatar Iuri Matias

comply with linter

parent e2f1d740
...@@ -36,10 +36,10 @@ function compileFileOrFiles (filename, isDirectory, cb) { ...@@ -36,10 +36,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
compiler.compile(sources, filepath) compiler.compile(sources, filepath)
} }
], function (err, result) { ], 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) { if (errors.length > 0) {
console.dir(errors); console.dir(errors)
return cb("errors compiling"); return cb(new Error('errors compiling'))
} }
cb(err, result.contracts) cb(err, result.contracts)
}) })
......
...@@ -31,7 +31,7 @@ function deployAll (compileResult, web3, callback) { ...@@ -31,7 +31,7 @@ function deployAll (compileResult, web3, callback) {
compiledObject[className].filename = filename compiledObject[className].filename = filename
compiledObject[className].className = className compiledObject[className].className = className
if (contractFile.indexOf("_test.sol") >=0 ) { if (contractFile.indexOf('_test.sol') >= 0) {
compiledObject[className].isTest = true compiledObject[className].isTest = true
} }
} }
...@@ -39,22 +39,22 @@ function deployAll (compileResult, web3, callback) { ...@@ -39,22 +39,22 @@ function deployAll (compileResult, web3, callback) {
next() next()
}, },
function determineContractsToDeploy (next) { function determineContractsToDeploy (next) {
let contractsToDeploy = ['Assert']; let contractsToDeploy = ['Assert']
let allContracts = Object.keys(compiledObject); let allContracts = Object.keys(compiledObject)
for (let contractName of allContracts) { for (let contractName of allContracts) {
if (contractName === 'Assert') { if (contractName === 'Assert') {
continue; continue
} }
if (compiledObject[contractName].isTest) { if (compiledObject[contractName].isTest) {
contractsToDeploy.push(contractName) contractsToDeploy.push(contractName)
} }
} }
next(null, contractsToDeploy); next(null, contractsToDeploy)
}, },
function deployContracts (contractsToDeploy, next) { function deployContracts (contractsToDeploy, next) {
async.eachOfLimit(contractsToDeploy, 1, function (contractName, index, nextEach) { 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 contractObject = new web3.eth.Contract(contract.abi)
let contractCode = '0x' + contract.code let contractCode = '0x' + contract.code
...@@ -76,7 +76,7 @@ function deployAll (compileResult, web3, callback) { ...@@ -76,7 +76,7 @@ function deployAll (compileResult, web3, callback) {
contractCode = contractCode.replace(new RegExp(toReplace, 'g'), contractObj.deployedAddress.slice(2)) 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.estimateGas().then((gasValue) => {
deployObject.send({ deployObject.send({
...@@ -93,7 +93,6 @@ function deployAll (compileResult, web3, callback) { ...@@ -93,7 +93,6 @@ function deployAll (compileResult, web3, callback) {
nextEach() nextEach()
}) })
}) })
}, function () { }, function () {
next(null, contracts) next(null, contracts)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment