move runCode

This commit is contained in:
Iuri Matias 2018-05-21 17:22:19 -04:00 committed by Jonathan Rainville
parent 592b4ed4fd
commit 3e9376138b
8 changed files with 1553 additions and 1671 deletions

View File

@ -0,0 +1,24 @@
let __mainContext;
class CodeRunner {
constructor(options) {
this.plugins = options.plugins;
this.logger = options.logger;
this.events = options.events;
}
registerVar(varName, code) {
__mainContext[varName] = code;
}
doEval(code) {
try {
// TODO: add trace log here
return eval(code);
} catch(e) {
throw new Error(e + "\n" + code);
}
}
}
module.exports = CodeRunner;

View File

@ -2,7 +2,7 @@ let async = require('async');
//require("../utils/debug_util.js")(__filename, async);
let utils = require('../utils/utils.js');
let RunCode = require('../core/runCode.js');
let RunCode = require('../coderunner/runCode.js');
class Deploy {
constructor(options) {

View File

@ -12,6 +12,7 @@ const ServicesMonitor = require('./services_monitor.js');
const Pipeline = require('../pipeline/pipeline.js');
const Watch = require('../pipeline/watch.js');
const LibraryManager = require('../versions/library_manager.js');
const CodeRunner = require('../coderunner/codeRunner.js');
class Engine {
constructor(options) {
@ -162,6 +163,12 @@ class Engine {
codeGeneratorService(_options) {
let self = this;
this.codeRunner = new CodeRunner({
plugins: self.plugins,
events: self.events,
logger: self.logger
});
this.codeGenerator = new CodeGenerator({
blockchainConfig: self.config.blockchainConfig,
contractsConfig: self.config.contractsConfig,

View File

@ -1,5 +1,5 @@
let utils = require('../utils/utils.js');
let RunCode = require('../core/runCode.js');
let RunCode = require('../coderunner/runCode.js');
class Console {
constructor(options) {

View File

@ -1,4 +1,4 @@
let RunCode = require('../../core/runCode.js');
let RunCode = require('../../coderunner/runCode.js');
const stringReplaceAsync = require('string-replace-async');
const async = require('async');

View File

@ -2,7 +2,7 @@ var async = require('async');
//require("../utils/debug_util.js")(__filename, async);
var Web3 = require('web3');
var Engine = require('../core/engine.js');
var RunCode = require('../core/runCode.js');
var RunCode = require('../coderunner/runCode.js');
var TestLogger = require('./test_logger.js');
var getSimulator = function() {

3185
package-lock.json generated

File diff suppressed because it is too large Load Diff