fix runActions in deployment; fix special configs

This commit is contained in:
Iuri Matias 2019-08-01 17:16:20 -04:00
parent 2931fce1ba
commit 454a710367
3 changed files with 8 additions and 8 deletions

View File

@ -18,8 +18,8 @@ class DeployTracker {
this.chainConfig = {}; this.chainConfig = {};
this.chainFile = embark.config.contractsConfig.tracking; this.chainFile = embark.config.contractsConfig.tracking;
// this.events.on("blockchain:started", this.loadChainTrackerFile.bind(this)); this.events.on("blockchain:started", this.loadChainTrackerFile.bind(this));
// this.embark.registerActionForEvent('deployment:deployContracts:beforeAll', this.setCurrentChain.bind(this)); this.embark.registerActionForEvent('deployment:deployContracts:beforeAll', this.setCurrentChain.bind(this));
// this.embark.registerActionForEvent("deployment:contract:deployed", this.trackAndSaveContract.bind(this)); // this.embark.registerActionForEvent("deployment:contract:deployed", this.trackAndSaveContract.bind(this));
// this.embark.registerActionForEvent("deploy:contract:shouldDeploy", this.checkIfDeploymentIsNeeded.bind(this)); // this.embark.registerActionForEvent("deploy:contract:shouldDeploy", this.checkIfDeploymentIsNeeded.bind(this));
} }
@ -61,8 +61,8 @@ class DeployTracker {
} }
setCurrentChain(_params, callback) { setCurrentChain(_params, callback) {
if (!this.embark.config.contractsConfig.tracking) return; if (!this.embark.config.contractsConfig.tracking) return callback();
if (this.chainFile === false) return; if (this.chainFile === false) return callback();
if (this.chainConfig === false) { if (this.chainConfig === false) {
this.currentChain = {contracts: []}; this.currentChain = {contracts: []};
return callback(); return callback();

View File

@ -27,11 +27,11 @@ class Deployment {
this.logger.info(__("deploying contracts")); this.logger.info(__("deploying contracts"));
async.waterfall([ async.waterfall([
// TODO used to be called this.plugins.emitAndRunActionsForEvent("deploy:beforeAll", (err) => { // TODO used to be called this.plugins.emitAndRunActionsForEvent("deploy:beforeAll", (err) => {
(next) => { this.plugins.emitAndRunActionsForEvent('deployment:deployContracts:beforeAll', () => { next() }); }, (next) => { this.plugins.emitAndRunActionsForEvent('deployment:deployContracts:beforeAll', {}, () => { next() }); },
(next) => { this.deployAll(contracts, contractDependencies, () => { next() }); }, (next) => { this.deployAll(contracts, contractDependencies, () => { next() }); },
(next) => { (next) => {
this.events.emit('contractsDeployed'); this.events.emit('contractsDeployed');
this.plugins.emitAndRunActionsForEvent('deployment:deployContracts:afterAll', () => { next() }); this.plugins.emitAndRunActionsForEvent('deployment:deployContracts:afterAll', {}, () => { next() });
console.dir("==== finished deploying"); console.dir("==== finished deploying");
} }
], done); ], done);

View File

@ -22,14 +22,14 @@ class SpecialConfigs {
this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.beforeDeployAction.bind(this)); this.embark.registerActionForEvent('deployment:contract:beforeDeploy', this.beforeDeployAction.bind(this));
} }
async beforeAllDeployAction(cb) { async beforeAllDeployAction(_params, cb) {
if (typeof this.config.contractsConfig.beforeDeploy !== 'function') { if (typeof this.config.contractsConfig.beforeDeploy !== 'function') {
return this.listConfigs.beforeAllDeployAction(cb); return this.listConfigs.beforeAllDeployAction(cb);
} }
return this.functionConfigs.beforeAllDeployAction(cb); return this.functionConfigs.beforeAllDeployAction(cb);
} }
async afterAllDeployAction(cb) { async afterAllDeployAction(_params, cb) {
if (typeof this.config.contractsConfig.afterDeploy !== 'function') { if (typeof this.config.contractsConfig.afterDeploy !== 'function') {
return this.listConfigs.afterAllDeployAction(cb); return this.listConfigs.afterAllDeployAction(cb);
} }