mirror of https://github.com/embarklabs/embark.git
add missing code init
This commit is contained in:
parent
ee460e3309
commit
ef3bde1053
|
@ -26,6 +26,7 @@ class CodeGenerator {
|
|||
this.contractsConfig = options.contractsConfig || {};
|
||||
this.storageConfig = options.storageConfig || {};
|
||||
this.communicationConfig = options.communicationConfig || {};
|
||||
this.namesystemConfig = options.namesystemConfig || {};
|
||||
// TODO: this should also be removed and use events instead
|
||||
this.contractsManager = options.contractsManager;
|
||||
this.plugins = options.plugins;
|
||||
|
@ -224,6 +225,17 @@ class CodeGenerator {
|
|||
return block;
|
||||
}
|
||||
|
||||
generateNamesInitialization(useEmbarkJS) {
|
||||
if (!useEmbarkJS || this.namesystemConfig === {}) return "";
|
||||
|
||||
let result = "\n";
|
||||
result += Templates.define_when_env_loaded();
|
||||
result += this._getInitCode('names', this.namesystemConfig);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
generateStorageInitialization(useEmbarkJS) {
|
||||
if (!useEmbarkJS || this.storageConfig === {}) return "";
|
||||
|
||||
|
@ -266,6 +278,7 @@ class CodeGenerator {
|
|||
result += this.generateContracts(options.useEmbarkJS, options.deployment, true);
|
||||
result += this.generateStorageInitialization(options.useEmbarkJS);
|
||||
result += this.generateCommunicationInitialization(options.useEmbarkJS);
|
||||
result += this.generateNamesInitialization(options.useEmbarkJS);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -331,6 +344,7 @@ class CodeGenerator {
|
|||
|
||||
code += self.generateCommunicationInitialization(true);
|
||||
code += self.generateStorageInitialization(true);
|
||||
code += self.generateNamesInitialization(true);
|
||||
next();
|
||||
},
|
||||
function writeFile(next) {
|
||||
|
|
|
@ -173,6 +173,7 @@ class Engine {
|
|||
contractsManager: this.contractsManager,
|
||||
plugins: self.plugins,
|
||||
storageConfig: self.config.storageConfig,
|
||||
namesystemConfig: self.config.namesystemConfig,
|
||||
communicationConfig: self.config.communicationConfig,
|
||||
events: self.events
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue