fixes due to bad rebase

This commit is contained in:
Iuri Matias 2018-08-22 18:36:34 -04:00 committed by Pascal Precht
parent 95df68e67c
commit 8ed808a101
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
4 changed files with 1919 additions and 5314 deletions

View File

@ -205,7 +205,6 @@ class Engine {
// TODO: still need to redeploy contracts because the original contracts // TODO: still need to redeploy contracts because the original contracts
// config is being corrupted // config is being corrupted
self.config.reloadConfig(); self.config.reloadConfig();
if (fileType === 'asset') { if (fileType === 'asset') {
// Throttle file changes so we re-write only once for all files // Throttle file changes so we re-write only once for all files
self.events.emit('asset-changed', path); self.events.emit('asset-changed', path);
@ -256,10 +255,6 @@ class Engine {
this.registerModule('library_manager'); this.registerModule('library_manager');
} }
codeCoverageService(_options) {
this.registerModule('coverage');
}
testRunnerService(options) { testRunnerService(options) {
this.registerModule('tests', Object.assign(options, {ipc: this.ipc})); this.registerModule('tests', Object.assign(options, {ipc: this.ipc}));
} }

View File

@ -379,3 +379,4 @@ class BlockchainConnector {
BlockchainConnector.ACCEPTED_TYPES = ['rpc', 'ws', 'vm']; BlockchainConnector.ACCEPTED_TYPES = ['rpc', 'ws', 'vm'];
module.exports = BlockchainConnector; module.exports = BlockchainConnector;

View File

@ -1,16 +1,16 @@
let async = require('async'); let async = require('async');
const utils = require('../utils/utils.js'); const ContractDeployer = require('./contract_deployer.js');
//require("../utils/debug_util.js")(__filename, async); const cloneDeep = require('clone-deep');
class DeployManager { class DeployManager {
constructor(options) { constructor(embark, options) {
const self = this; const self = this;
this.config = options.config; this.config = embark.config;
this.logger = options.logger; this.logger = embark.logger;
this.blockchainConfig = this.config.blockchainConfig; this.blockchainConfig = this.config.blockchainConfig;
this.events = options.events; this.events = embark.events;
this.plugins = options.plugins; this.plugins = options.plugins;
this.blockchain = options.blockchain; this.blockchain = options.blockchain;
this.gasLimit = false; this.gasLimit = false;
@ -18,21 +18,38 @@ class DeployManager {
this.deployOnlyOnConfig = false; this.deployOnlyOnConfig = false;
this.onlyCompile = options.onlyCompile !== undefined ? options.onlyCompile : 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) => { this.events.setCommandHandler('deploy:contracts', (cb) => {
self.deployContracts(cb); self.deployContracts(cb);
}); });
this.events.setCommandHandler('deploy:contracts:test', (cb) => {
self.fatalErrors = true;
self.deployOnlyOnConfig = true;
self.deployContracts(cb);
});
} }
deployAll(done) { deployAll(done) {
let self = this; let self = this;
self.events.request('contracts:list', (err, contracts) => { self.events.request('contracts:dependencies', (err, contractDependencies) => {
if (err) { self.events.request('contracts:list', (err, contracts) => {
return done(err); if (err) {
} return done(err);
}
self.logger.info(__("deploying contracts")); self.logger.info(__("deploying contracts"));
self.events.emit("deploy:beforeAll"); self.events.emit("deploy:beforeAll");
try { try {
async.auto(contractDeploys, 1, function(_err, _results) { async.auto(contractDeploys, 1, function(_err, _results) {
@ -56,8 +73,8 @@ class DeployManager {
} }
self.logger.info(__("finished deploying contracts")); self.logger.info(__("finished deploying contracts"));
done(err); done(err);
} });
); });
}); });
} }
@ -71,6 +88,13 @@ class DeployManager {
} }
async.waterfall([ async.waterfall([
function requestBlockchainConnector(callback) {
self.events.request("blockchain:object", (blockchain) => {
self.blockchain = blockchain;
callback();
});
},
function buildContracts(callback) { function buildContracts(callback) {
self.events.request("contracts:build", self.deployOnlyOnConfig, (err) => { self.events.request("contracts:build", self.deployOnlyOnConfig, (err) => {
callback(err); callback(err);
@ -78,8 +102,8 @@ class DeployManager {
}, },
// TODO: shouldn't be necessary // TODO: shouldn't be necessary
function checkCompileOnly(callback){ function checkCompileOnly(callback) {
if(self.onlyCompile){ if (self.onlyCompile) {
self.events.emit('contractsDeployed'); self.events.emit('contractsDeployed');
return done(); return done();
} }

7171
package-lock.json generated

File diff suppressed because it is too large Load Diff