mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-24 03:18:31 +00:00
add emitAndRunActionsForEvent
This commit is contained in:
parent
45f7767313
commit
4f20d31b4c
@ -192,8 +192,7 @@ class ContractDeployer {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function applyBeforeDeploy(next) {
|
function applyBeforeDeploy(next) {
|
||||||
self.events.emit('deploy:contract:beforeDeploy', {contract: contract});
|
self.plugins.emitAndRunActionsForEvent('deploy:contract:beforeDeploy', {contract: contract}, next);
|
||||||
self.plugins.runActionsForEvent('deploy:contract:beforeDeploy', {contract: contract}, next);
|
|
||||||
},
|
},
|
||||||
function createDeployObject(next) {
|
function createDeployObject(next) {
|
||||||
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
||||||
|
@ -104,8 +104,7 @@ class DeployManager {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function runAfterDeploy(callback) {
|
function runAfterDeploy(callback) {
|
||||||
self.events.emit('contracts:deploy:afterAll');
|
self.plugins.emitAndRunActionsForEvent('contracts:deploy:afterAll', callback);
|
||||||
self.plugins.runActionsForEvent('contracts:deploy:afterAll', callback);
|
|
||||||
}
|
}
|
||||||
], function (err, _result) {
|
], function (err, _result) {
|
||||||
done(err);
|
done(err);
|
||||||
|
@ -138,4 +138,9 @@ Plugins.prototype.runActionsForEvent = function(eventName, args, cb) {
|
|||||||
}, cb);
|
}, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Plugins.prototype.emitAndRunActionsForEvent = function(eventName, args, cb) {
|
||||||
|
this.events.emit(eventName);
|
||||||
|
return this.runActionsForEvent(eventName, args, cb);
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = Plugins;
|
module.exports = Plugins;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user