mirror of https://github.com/embarklabs/embark.git
move deployment to a module
This commit is contained in:
parent
f9321776b1
commit
40e58dbcf2
|
@ -216,16 +216,7 @@ class Engine {
|
|||
events: this.events
|
||||
});
|
||||
|
||||
const DeployManager = require('../modules/deployment/index.js');
|
||||
this.deployManager = new DeployManager({
|
||||
config: this.config,
|
||||
logger: this.logger,
|
||||
events: this.events
|
||||
}, {
|
||||
blockchain: this.blockchain,
|
||||
plugins: this.plugins,
|
||||
onlyCompile: options.onlyCompile
|
||||
});
|
||||
this.registerModule('deployment', {blockchain: this.blockchain, plugins: this.plugins, onlyCompile: options.onlyCompile});
|
||||
|
||||
this.events.on('file-event', function (fileType) {
|
||||
clearTimeout(self.fileTimeout);
|
||||
|
|
|
@ -33,6 +33,12 @@ class DeployManager {
|
|||
this.events.setCommandHandler('deploy:contracts', (cb) => {
|
||||
self.deployContracts(cb);
|
||||
});
|
||||
|
||||
this.events.setCommandHandler('deploy:contracts:test', (cb) => {
|
||||
self.fatalErrors = true;
|
||||
self.deployOnlyOnConfig = true;
|
||||
self.deployContracts(cb);
|
||||
});
|
||||
}
|
||||
|
||||
deployAll(done) {
|
||||
|
|
|
@ -104,7 +104,7 @@ module.exports = {
|
|||
mocha.reporter(EmbarkSpec, {
|
||||
events: global.embark.engine.events,
|
||||
gasDetails: options.gasDetails,
|
||||
gasLimit: global.embark.engine.deployManager.gasLimit
|
||||
gasLimit: 6000000
|
||||
});
|
||||
mocha.addFile(file);
|
||||
|
||||
|
|
|
@ -304,9 +304,7 @@ class Test {
|
|||
});
|
||||
},
|
||||
function deploy(accounts, next) {
|
||||
self.engine.deployManager.fatalErrors = true;
|
||||
self.engine.deployManager.deployOnlyOnConfig = true;
|
||||
self.engine.events.request('deploy:contracts', () => {
|
||||
self.engine.events.request('deploy:contracts:test', () => {
|
||||
next(null, accounts);
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue