diff --git a/src/deployer.js b/src/deployer.js index e79e9e7eca..d91438f697 100644 --- a/src/deployer.js +++ b/src/deployer.js @@ -53,7 +53,7 @@ function deployAll (compileResult, web3, callback) { next(null, contractsToDeploy) }, function deployContracts (contractsToDeploy, next) { - var deployRunner = (deployObject, contractObject, contractName, callback) => { + var deployRunner = (deployObject, contractObject, contractName, filename, callback) => { deployObject.estimateGas().then((gasValue) => { deployObject.send({ from: accounts[0], @@ -65,6 +65,7 @@ function deployAll (compileResult, web3, callback) { compiledObject[contractName].deployedAddress = receipt.contractAddress contracts[contractName] = contractObject + contracts[contractName].filename = filename callback(null, { result: { createdAddress: receipt.contractAddress } }) // TODO this will only work with JavaScriptV VM }).on('error', function (err) { @@ -80,7 +81,7 @@ function deployAll (compileResult, web3, callback) { if (error) return nextEach(error) let contractObject = new web3.eth.Contract(contract.abi) let deployObject = contractObject.deploy({arguments: [], data: '0x' + contractDeployData.dataHex}) - deployRunner(deployObject, contractObject, contractName, (error) => { nextEach(error) }) + deployRunner(deployObject, contractObject, contractName, contract.filename, (error) => { nextEach(error) }) } let encodeDataStepCallback = (msg) => { console.dir(msg) } @@ -90,7 +91,7 @@ function deployAll (compileResult, web3, callback) { let code = compiledObject[libData.data.contractName].code let libraryObject = new web3.eth.Contract(abi) let deployObject = libraryObject.deploy({arguments: [], data: '0x' + code}) - deployRunner(deployObject, libraryObject, libData.data.contractName, callback) + deployRunner(deployObject, libraryObject, libData.data.contractName, contract.filename, callback) } let funAbi = null // no need to set the abi for encoding the constructor diff --git a/src/testRunner.js b/src/testRunner.js index 94c0d53dde..6b2444fd3e 100644 --- a/src/testRunner.js +++ b/src/testRunner.js @@ -38,7 +38,7 @@ function runTest (testName, testObject, testCallback, resultsCallback) { let timePassed = 0 let web3 = new Web3() - testCallback({type: 'contract', value: testName}) + testCallback({type: 'contract', value: testName, filename: testObject.filename}) async.eachOfLimit(runList, 1, function (func, index, next) { let method = testObject.methods[func.name].apply(testObject.methods[func.name], []) let startTime = Date.now() diff --git a/tests/testRunner.js b/tests/testRunner.js index 66a784e960..d5529050d0 100644 --- a/tests/testRunner.js +++ b/tests/testRunner.js @@ -52,7 +52,7 @@ describe('testRunner', function () { it('should returns 3 messages', function () { assert.deepEqual(tests, [ - { type: 'contract', value: 'MyTest' }, + { type: 'contract', value: 'MyTest', filename: 'simple_storage_test.sol' }, { type: 'testPass', value: 'Initial value should be100', time: 1, context: 'MyTest' }, { type: 'testFailure', value: 'Initial value should be200', time: 1, context: 'MyTest', errMsg: 'function returned false' } ]) @@ -86,7 +86,7 @@ describe('testRunner', function () { it('should returns 3 messages', function () { assert.deepEqual(tests, [ - { type: 'contract', value: 'MyTest' }, + { type: 'contract', value: 'MyTest', filename: 'simple_storage_test.sol' }, { type: 'testPass', value: 'Initial value should be100', time: 1, context: 'MyTest' }, { type: 'testPass', value: 'Initial value should be200', time: 1, context: 'MyTest' } ])