Unverified Commit b39483fe authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1049 from ethereum/fixUnitTesting

Fix unit testing error message
parents 8a4a1510 379dbfac
...@@ -122,6 +122,7 @@ web3VmProvider.prototype.txProcessed = function (self, data) { ...@@ -122,6 +122,7 @@ web3VmProvider.prototype.txProcessed = function (self, data) {
} }
self.txsReceipt[self.processingHash].logs = logs self.txsReceipt[self.processingHash].logs = logs
self.txsReceipt[self.processingHash].transactionHash = self.processingHash self.txsReceipt[self.processingHash].transactionHash = self.processingHash
self.txsReceipt[self.processingHash].status = '0x' + data.vm.exception.toString(16)
if (data.createdAddress) { if (data.createdAddress) {
var address = util.hexConvert(data.createdAddress) var address = util.hexConvert(data.createdAddress)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"main": "./index.js", "main": "./index.js",
"dependencies": { "dependencies": {
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"babel-eslint": "^7.1.1",
"babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-es2017": "^6.24.1", "babel-preset-es2017": "^6.24.1",
"babelify": "^7.3.0", "babelify": "^7.3.0",
...@@ -23,7 +24,7 @@ ...@@ -23,7 +24,7 @@
"express": "^4.16.3", "express": "^4.16.3",
"fast-async": "^6.3.7", "fast-async": "^6.3.7",
"merge": "^1.2.0", "merge": "^1.2.0",
"remix-lib": "^0.2.5", "remix-lib": "0.3.10",
"standard": "^10.0.3", "standard": "^10.0.3",
"time-stamp": "^2.0.0", "time-stamp": "^2.0.0",
"web3": "1.0.0-beta.27" "web3": "1.0.0-beta.27"
......
...@@ -39,7 +39,7 @@ Transactions.prototype.eth_getTransactionReceipt = function (payload, cb) { ...@@ -39,7 +39,7 @@ Transactions.prototype.eth_getTransactionReceipt = function (payload, cb) {
'cumulativeGasUsed': '0x06345f', 'cumulativeGasUsed': '0x06345f',
'contractAddress': receipt.contractAddress, 'contractAddress': receipt.contractAddress,
'logs': receipt.logs, 'logs': receipt.logs,
'status': 1 'status': receipt.status
} }
cb(null, r) cb(null, r)
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"signale": "^1.2.1", "signale": "^1.2.1",
"solc": "^0.4.24", "solc": "^0.4.24",
"standard": "^10.0.3", "standard": "^10.0.3",
"web3": "1.0.0-beta.34", "web3": "1.0.0-beta.36",
"winston": "^3.0.0" "winston": "^3.0.0"
}, },
"peerDependencies": { "peerDependencies": {
......
...@@ -71,7 +71,7 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) { ...@@ -71,7 +71,7 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) {
}) })
} }
function compileContractSources (sources, importFileCb, cb, opts) { function compileContractSources (sources, importFileCb, opts, cb) {
let compiler, filepath let compiler, filepath
let accounts = opts.accounts || [] let accounts = opts.accounts || []
// Iterate over sources keys. Inject test libraries. Inject test library import statements. // Iterate over sources keys. Inject test libraries. Inject test library import statements.
......
...@@ -29,7 +29,7 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi ...@@ -29,7 +29,7 @@ var runTestSources = function (contractSources, testCallback, resultCallback, fi
}) })
}, },
function compile (next) { function compile (next) {
Compiler.compileContractSources(contractSources, importFileCb, next) Compiler.compileContractSources(contractSources, importFileCb, { accounts }, next)
}, },
function deployAllContracts (compilationResult, next) { function deployAllContracts (compilationResult, next) {
Deployer.deployAll(compilationResult, web3, function (err, contracts) { Deployer.deployAll(compilationResult, web3, function (err, contracts) {
......
...@@ -133,8 +133,8 @@ function runTest (testName, testObject, contractDetails, opts, testCallback, res ...@@ -133,8 +133,8 @@ function runTest (testName, testObject, contractDetails, opts, testCallback, res
next(err) next(err)
}) })
} }
}, function () { }, function (error) {
resultsCallback(null, { resultsCallback(error, {
passingNum: passingNum, passingNum: passingNum,
failureNum: failureNum, failureNum: failureNum,
timePassed: timePassed timePassed: timePassed
......
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