support mapping contract file in contracts config

This commit is contained in:
Iuri Matias 2018-04-12 17:54:08 -04:00
parent 17b960e803
commit e3fde1ad22
2 changed files with 18 additions and 0 deletions

View File

@ -47,6 +47,7 @@ Config.prototype.loadConfigFiles = function(options) {
this.loadPipelineConfigFile();
this.loadContractsConfigFile();
this.loadExternalContractsFiles();
this.loadWebServerConfigFile();
this.loadChainTrackerFile();
this.loadPluginContractFiles();
@ -60,6 +61,7 @@ Config.prototype.reloadConfig = function() {
this.loadContractsConfigFile();
this.loadPipelineConfigFile();
this.loadContractsConfigFile();
this.loadExternalContractsFiles();
this.loadChainTrackerFile();
};
@ -140,6 +142,16 @@ Config.prototype.loadContractsConfigFile = function() {
this.contractsConfig = this._mergeConfig(configFilePath, configObject, this.env);
};
Config.prototype.loadExternalContractsFiles = function() {
let contracts = this.contractsConfig.contracts;
for (let contractName in contracts) {
let contract = contracts[contractName];
if (contract.file) {
this.contractsFiles.push(new File({filename: contract.file, type: "dapp_file", basedir: '', path: contract.file}));
}
}
};
Config.prototype.loadStorageConfigFile = function() {
var versions = utils.recursiveMerge({"ipfs-api": "17.2.4"}, this.embarkConfig.versions || {});

View File

@ -62,6 +62,12 @@
["$MyToken2", "$SimpleStorage"],
100
]
},
"SimpleStorageTest": {
"file": "./some_folder/test_contract.sol",
"args": [
1000
]
}
},
"afterDeploy": [