Merge branch 'upcoming' into develop

This commit is contained in:
Iuri Matias 2016-03-08 15:00:03 -05:00
commit 558de7c136
5 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@
miner_obj.start(config.threads); miner_obj.start(config.threads);
return; return;
} }
miner_obj.stop(); miner_obj.stop(config.threads);
fundAccount(config, miner_obj, function () { fundAccount(config, miner_obj, function () {
if (config.mine_periodically) start_periodic_mining(config, miner_obj); if (config.mine_periodically) start_periodic_mining(config, miner_obj);
@ -64,7 +64,7 @@
console.log("== Account funded"); console.log("== Account funded");
blockWatcher.stopWatching(); blockWatcher.stopWatching();
miner_obj.stop(); miner_obj.stop(config.threads);
cb(); cb();
} }
}); });
@ -106,7 +106,7 @@
next_block_in_ms = (config.interval_ms - ms_since_block); next_block_in_ms = (config.interval_ms - ms_since_block);
} }
miner_obj.stop(); miner_obj.stop(config.threads);
console.log("== Looking for next block in " + next_block_in_ms + "ms"); console.log("== Looking for next block in " + next_block_in_ms + "ms");
setTimeout(function () { setTimeout(function () {
@ -130,7 +130,7 @@
web3.eth.filter("latest").watch(function () { web3.eth.filter("latest").watch(function () {
if (!pendingTransactions()) { if (!pendingTransactions()) {
console.log("== No transactions left. Stopping miner..."); console.log("== No transactions left. Stopping miner...");
miner_obj.stop(); miner_obj.stop(config.threads);
} }
}); });
}; };

View File

@ -10,7 +10,7 @@ describe('embark.blockchain', function() {
var blockchain = new Blockchain(blockchainConfig); var blockchain = new Blockchain(blockchainConfig);
it('should return correct cmd', function() { it('should return correct cmd', function() {
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --rpcaddr localhost --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --genesis=\"config/genesis.json\" --rpcapi \"eth,web3\" --maxpeers 4 --password config/password "); assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --rpcaddr localhost --networkid "+blockchainConfig.networkId+" --rpccorsdomain * --minerthreads \"1\" --genesis=\"config/genesis.json\" --rpcapi \"eth,web3\" --maxpeers 4 --password config/password ");
}); });
}); });

View File

@ -20,7 +20,7 @@ describe('embark.chain_manager', function() {
chainManager.init('development', blockchainConfig, web3); chainManager.init('development', blockchainConfig, web3);
it('should initialize chain', function() { it('should initialize chain', function() {
var chain = chainManager.chainManagerConfig['0x021a83120c235da14ec41c513dabf7e56e5d8a820177df9da3d1fd2b9c2daf91'] var chain = chainManager.chainManagerConfig['0xc16b5bca90004b19e2d8d49b2fcaaa8a42c58ec46fe293a6962e6eeee084872c']
assert.equal(chain != undefined, true); assert.equal(chain != undefined, true);
}); });
}); });
@ -31,7 +31,7 @@ describe('embark.chain_manager', function() {
chainManager.addContract("Foo", "123456", [], "0x123"); chainManager.addContract("Foo", "123456", [], "0x123");
console.log(chainManager.chainManagerConfig); console.log(chainManager.chainManagerConfig);
var chain = chainManager.chainManagerConfig['0x021a83120c235da14ec41c513dabf7e56e5d8a820177df9da3d1fd2b9c2daf91'] var chain = chainManager.chainManagerConfig['0xc16b5bca90004b19e2d8d49b2fcaaa8a42c58ec46fe293a6962e6eeee084872c']
var contract = chain.contracts["d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b"] var contract = chain.contracts["d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b"]
assert.equal(contract.name, "Foo"); assert.equal(contract.name, "Foo");
@ -58,7 +58,7 @@ describe('embark.chain_manager', function() {
var chainFile = './test/support/chain_manager.json'; var chainFile = './test/support/chain_manager.json';
var content = fs.readFileSync(chainFile).toString(); var content = fs.readFileSync(chainFile).toString();
assert.equal(content, '{"0x021a83120c235da14ec41c513dabf7e56e5d8a820177df9da3d1fd2b9c2daf91":{"contracts":{"d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b\":{"name":"Foo","address":"0x123"}}}}'); assert.equal(content, '{"0xc16b5bca90004b19e2d8d49b2fcaaa8a42c58ec46fe293a6962e6eeee084872c":{"contracts":{"d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b\":{"name":"Foo","address":"0x123"}}}}');
}); });
}); });

View File

@ -77,7 +77,7 @@ describe('embark.deploy', function() {
result += deploy.generate_provider_file(); result += deploy.generate_provider_file();
result += deploy.generate_abi_file(); result += deploy.generate_abi_file();
assert.strictEqual(result, "web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');"); assert.strictEqual(result, "web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];blockchain = {\"rpcHost\":\"localhost\",\"rpcPort\":8101,\"gasLimit\":1000000,\"gasPrice\":10000000000000,\"rpcWhitelist\":\"*\",\"nat\":[],\"minerthreads\":1,\"genesisBlock\":\"config/genesis.json\",\"datadir\":\"/tmp/embark\",\"bootNodes\":[],\"deployTimeout\":20,\"networkId\":"+deploy.blockchainConfig.networkId+",\"maxPeers\":4,\"mine\":false,\"port\":\"30303\",\"console_toggle\":false,\"mine_when_needed\":true,\"whisper\":false,\"account\":{\"init\":true,\"password\":\"config/password\"},\"geth_extra_opts\":[],\"testnet\":false,\"deploy_synchronously\":false};SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');contractDB = {\"SimpleStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":123}}},\"AnotherStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":234}}}};");
}); });
}); });
}); });

View File

@ -1 +1 @@
{"0x021a83120c235da14ec41c513dabf7e56e5d8a820177df9da3d1fd2b9c2daf91":{"contracts":{"d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b":{"name":"Foo","address":"0x123"}}}} {"0xc16b5bca90004b19e2d8d49b2fcaaa8a42c58ec46fe293a6962e6eeee084872c":{"contracts":{"d5d91a8825c5c253dff531ddda2354c4014f5699b7bcbea70207cfdcb37b6c8b":{"name":"Foo","address":"0x123"}}}}