support mapping contract file in contracts config
This commit is contained in:
parent
17b960e803
commit
e3fde1ad22
|
@ -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 || {});
|
||||
|
||||
|
|
|
@ -62,6 +62,12 @@
|
|||
["$MyToken2", "$SimpleStorage"],
|
||||
100
|
||||
]
|
||||
},
|
||||
"SimpleStorageTest": {
|
||||
"file": "./some_folder/test_contract.sol",
|
||||
"args": [
|
||||
1000
|
||||
]
|
||||
}
|
||||
},
|
||||
"afterDeploy": [
|
||||
|
|
Loading…
Reference in New Issue