From d2e8b545f1e5287e2b6ef0a05d45cd7c7d33cbc1 Mon Sep 17 00:00:00 2001 From: Ryan Casey Date: Wed, 9 Mar 2016 21:30:54 +0000 Subject: [PATCH 1/2] Allow specifiying the gas limit when instantiating a Web3 provider. --- lib/blockchain.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/blockchain.js b/lib/blockchain.js index 55491da45..f499af64b 100644 --- a/lib/blockchain.js +++ b/lib/blockchain.js @@ -15,6 +15,7 @@ Blockchain = function(logger, options) { this.blockLogs = {}; this.coinbase = null; this.contracts = {}; + this.gasLimit = options.gasLimit || '0x2fefd8'; this.blockHashes = {}; this.transactions = {}; this.latest_filter_id = 1; @@ -92,7 +93,7 @@ Blockchain.prototype.createBlock = function() { var block = new Block(); var parent = this.blocks.length != 0 ? this.blocks[this.blocks.length - 1] : null; - block.header.gasLimit = '0x2fefd8'; + block.header.gasLimit = this.gasLimit; // Ensure we have the right block number for the VM. block.header.number = this.toHex(this.blocks.length); From 5bd48eb36c084d282cfff0020016da598497de93 Mon Sep 17 00:00:00 2001 From: Ryan Casey Date: Thu, 10 Mar 2016 00:53:03 +0000 Subject: [PATCH 2/2] Expose engine's stop and start functions. --- lib/server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/server.js b/lib/server.js index 6b5723168..7d56b8be4 100644 --- a/lib/server.js +++ b/lib/server.js @@ -188,6 +188,12 @@ Server = { }, send: function() { throw new Error("Synchronous requests are not supported."); + }, + start: function() { + engine.start(); + }, + stop: function() { + engine.stop(); } }; },