track original filepath of the contract

This commit is contained in:
Iuri Matias 2018-04-17 17:51:36 -04:00
parent a7f1d3c21e
commit 433fd6f11e
2 changed files with 7 additions and 0 deletions

View File

@ -122,6 +122,7 @@ class ContractsManager {
contract.functionHashes = compiledContract.functionHashes;
contract.abiDefinition = compiledContract.abiDefinition;
contract.filename = compiledContract.filename;
contract.originalFilename = compiledContract.originalFilename || ("contracts/" + contract.filename);
contract.gas = (contractConfig && contractConfig.gas) || self.contractsConfig.gas || 'auto';

View File

@ -22,6 +22,9 @@ class Solidity {
}
let self = this;
let input = {};
let solcW;
let originalFilepath = {};
async.waterfall([
function prepareInput(callback) {
async.each(contractFiles,
@ -33,6 +36,8 @@ class Solidity {
filename = filename.replace(match, '');
}
originalFilepath[filename] = file.filename;
file.content(function(fileContent) {
if (!fileContent) {
self.logger.error(__('Error while loading the content of ') + filename);
@ -140,6 +145,7 @@ class Solidity {
compiled_object[className].functionHashes = contract.evm.methodIdentifiers;
compiled_object[className].abiDefinition = contract.abi;
compiled_object[className].filename = filename;
compiled_object[className].originalFilename = originalFilepath[filename];
}
}