mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-09 13:36:14 +00:00
track original filepath of the contract
This commit is contained in:
parent
a7f1d3c21e
commit
433fd6f11e
@ -122,6 +122,7 @@ class ContractsManager {
|
|||||||
contract.functionHashes = compiledContract.functionHashes;
|
contract.functionHashes = compiledContract.functionHashes;
|
||||||
contract.abiDefinition = compiledContract.abiDefinition;
|
contract.abiDefinition = compiledContract.abiDefinition;
|
||||||
contract.filename = compiledContract.filename;
|
contract.filename = compiledContract.filename;
|
||||||
|
contract.originalFilename = compiledContract.originalFilename || ("contracts/" + contract.filename);
|
||||||
|
|
||||||
contract.gas = (contractConfig && contractConfig.gas) || self.contractsConfig.gas || 'auto';
|
contract.gas = (contractConfig && contractConfig.gas) || self.contractsConfig.gas || 'auto';
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@ class Solidity {
|
|||||||
}
|
}
|
||||||
let self = this;
|
let self = this;
|
||||||
let input = {};
|
let input = {};
|
||||||
|
let solcW;
|
||||||
|
let originalFilepath = {};
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function prepareInput(callback) {
|
function prepareInput(callback) {
|
||||||
async.each(contractFiles,
|
async.each(contractFiles,
|
||||||
@ -33,6 +36,8 @@ class Solidity {
|
|||||||
filename = filename.replace(match, '');
|
filename = filename.replace(match, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
originalFilepath[filename] = file.filename;
|
||||||
|
|
||||||
file.content(function(fileContent) {
|
file.content(function(fileContent) {
|
||||||
if (!fileContent) {
|
if (!fileContent) {
|
||||||
self.logger.error(__('Error while loading the content of ') + filename);
|
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].functionHashes = contract.evm.methodIdentifiers;
|
||||||
compiled_object[className].abiDefinition = contract.abi;
|
compiled_object[className].abiDefinition = contract.abi;
|
||||||
compiled_object[className].filename = filename;
|
compiled_object[className].filename = filename;
|
||||||
|
compiled_object[className].originalFilename = originalFilepath[filename];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user