catch and return deployment error in remix-tests

pull/7/head
aniket-engg 5 years ago
parent 807ffd9772
commit 36a2d717f2
  1. 3
      remix-tests/src/deployer.ts
  2. 2
      remix-tests/src/runTestSources.ts

@ -102,7 +102,8 @@ export function deployAll(compileResult: object, web3: Web3, callback) {
let funAbi = null // no need to set the abi for encoding the constructor
let params = '' // we suppose that the test contract does not have any param in the constructor
remixLib.execution.txFormat.encodeConstructorCallAndDeployLibraries(contractName, contract.raw, compileResult, params, funAbi, encodeDataFinalCallback, encodeDataStepCallback, encodeDataDeployLibraryCallback)
}, function () {
}, function (err) {
if(err) next(err)
next(null, contracts)
})
}

@ -51,7 +51,7 @@ export async function runTestSources(contractSources: SrcIfc, versionUrl: string
}
deployAll(compilationResult, web3, (err, contracts) => {
if (err) {
next(err)
next([{message: 'contract deployment failed: ' + err.message, severity: 'error'}]) // IDE expects errors in array
}
next(null, compilationResult, contracts)

Loading…
Cancel
Save