make ethersim optional
This commit is contained in:
parent
402f8fed57
commit
7b9de1b259
|
@ -6,7 +6,6 @@ var wrench = require('wrench');
|
|||
var grunt = require('grunt');
|
||||
require('shelljs/global');
|
||||
var readYaml = require('read-yaml');
|
||||
var EtherSim = require('ethersim');
|
||||
var Embark = require('..');
|
||||
|
||||
var run = function(cmd) {
|
||||
|
@ -175,6 +174,13 @@ program.command('meteor_demo').description('create a working meteor dapp with a
|
|||
});
|
||||
|
||||
program.command('simulator').description('run a fast ethereum rpc simulator').action(function() {
|
||||
try {
|
||||
var EtherSim = require('ethersim');
|
||||
} catch(e) {
|
||||
console.log('EtherSim not found; Please install it with "npm install ethersim --save"');
|
||||
console.log('For more information see https://github.com/iurimatias/ethersim');
|
||||
exit();
|
||||
}
|
||||
EtherSim.startServer();
|
||||
});
|
||||
|
||||
|
|
10
lib/test.js
10
lib/test.js
|
@ -1,7 +1,17 @@
|
|||
try {
|
||||
var ethersim = require('ethersim');
|
||||
} catch(e) {
|
||||
var ethersim = false;
|
||||
}
|
||||
var web3 = require('web3');
|
||||
|
||||
Test = function(contractFiles, blockchainFile, contractFile, _env) {
|
||||
if (ethersim === false) {
|
||||
console.log('EtherSim not found; Please install it with "npm install ethersim --save"');
|
||||
console.log('For more information see https://github.com/iurimatias/ethersim');
|
||||
exit();
|
||||
}
|
||||
|
||||
this.env = _env || 'development';
|
||||
this.web3 = web3;
|
||||
this.web3.setProvider(ethersim.web3Provider());
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
"toposort": "^0.2.10",
|
||||
"web3": "^0.15.0",
|
||||
"bignumber.js": "debris/bignumber.js#master",
|
||||
"wrench": "^1.5.8",
|
||||
"ethersim": "^0.3.0"
|
||||
"wrench": "^1.5.8"
|
||||
},
|
||||
"author": "Iuri Matias <iuri.matias@gmail.com>",
|
||||
"contributors": [],
|
||||
|
|
Loading…
Reference in New Issue