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