mirror of https://github.com/embarklabs/embark.git
fixes due to bad rebase
This commit is contained in:
parent
95df68e67c
commit
8ed808a101
|
@ -205,7 +205,6 @@ class Engine {
|
|||
// TODO: still need to redeploy contracts because the original contracts
|
||||
// config is being corrupted
|
||||
self.config.reloadConfig();
|
||||
|
||||
if (fileType === 'asset') {
|
||||
// Throttle file changes so we re-write only once for all files
|
||||
self.events.emit('asset-changed', path);
|
||||
|
@ -256,10 +255,6 @@ class Engine {
|
|||
this.registerModule('library_manager');
|
||||
}
|
||||
|
||||
codeCoverageService(_options) {
|
||||
this.registerModule('coverage');
|
||||
}
|
||||
|
||||
testRunnerService(options) {
|
||||
this.registerModule('tests', Object.assign(options, {ipc: this.ipc}));
|
||||
}
|
||||
|
|
|
@ -379,3 +379,4 @@ class BlockchainConnector {
|
|||
|
||||
BlockchainConnector.ACCEPTED_TYPES = ['rpc', 'ws', 'vm'];
|
||||
module.exports = BlockchainConnector;
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
let async = require('async');
|
||||
|
||||
const utils = require('../utils/utils.js');
|
||||
//require("../utils/debug_util.js")(__filename, async);
|
||||
const ContractDeployer = require('./contract_deployer.js');
|
||||
const cloneDeep = require('clone-deep');
|
||||
|
||||
class DeployManager {
|
||||
constructor(options) {
|
||||
constructor(embark, options) {
|
||||
const self = this;
|
||||
this.config = options.config;
|
||||
this.logger = options.logger;
|
||||
this.config = embark.config;
|
||||
this.logger = embark.logger;
|
||||
this.blockchainConfig = this.config.blockchainConfig;
|
||||
|
||||
this.events = options.events;
|
||||
this.events = embark.events;
|
||||
this.plugins = options.plugins;
|
||||
this.blockchain = options.blockchain;
|
||||
this.gasLimit = false;
|
||||
|
@ -18,21 +18,38 @@ class DeployManager {
|
|||
this.deployOnlyOnConfig = false;
|
||||
this.onlyCompile = options.onlyCompile !== undefined ? options.onlyCompile : false;
|
||||
|
||||
this.contractDeployer = new ContractDeployer({
|
||||
logger: this.logger,
|
||||
events: this.events,
|
||||
plugins: this.plugins
|
||||
});
|
||||
|
||||
this.events.setCommandHandler('deploy:setGasLimit', (gasLimit) => {
|
||||
self.gasLimit = gasLimit;
|
||||
});
|
||||
|
||||
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) {
|
||||
let self = this;
|
||||
|
||||
self.events.request('contracts:list', (err, contracts) => {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
self.events.request('contracts:dependencies', (err, contractDependencies) => {
|
||||
self.events.request('contracts:list', (err, contracts) => {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
|
||||
self.logger.info(__("deploying contracts"));
|
||||
self.events.emit("deploy:beforeAll");
|
||||
self.logger.info(__("deploying contracts"));
|
||||
self.events.emit("deploy:beforeAll");
|
||||
|
||||
try {
|
||||
async.auto(contractDeploys, 1, function(_err, _results) {
|
||||
|
@ -56,8 +73,8 @@ class DeployManager {
|
|||
}
|
||||
self.logger.info(__("finished deploying contracts"));
|
||||
done(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -71,6 +88,13 @@ class DeployManager {
|
|||
}
|
||||
|
||||
async.waterfall([
|
||||
function requestBlockchainConnector(callback) {
|
||||
self.events.request("blockchain:object", (blockchain) => {
|
||||
self.blockchain = blockchain;
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
||||
function buildContracts(callback) {
|
||||
self.events.request("contracts:build", self.deployOnlyOnConfig, (err) => {
|
||||
callback(err);
|
||||
|
@ -78,8 +102,8 @@ class DeployManager {
|
|||
},
|
||||
|
||||
// TODO: shouldn't be necessary
|
||||
function checkCompileOnly(callback){
|
||||
if(self.onlyCompile){
|
||||
function checkCompileOnly(callback) {
|
||||
if (self.onlyCompile) {
|
||||
self.events.emit('contractsDeployed');
|
||||
return done();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue