From a34321d1e482e8d83b31c9ab076c3560ebab3472 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Mon, 23 Mar 2015 16:50:13 +0100 Subject: [PATCH] removed double FakeHTTPProvidor --- lib/web3/eth.js | 6 ++--- test/FakeHttpProvider.js | 58 ---------------------------------------- 2 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 test/FakeHttpProvider.js diff --git a/lib/web3/eth.js b/lib/web3/eth.js index e36e9a3..c61302f 100644 --- a/lib/web3/eth.js +++ b/lib/web3/eth.js @@ -182,15 +182,13 @@ var compileSolidity = new Method({ var compileLLL = new Method({ name: 'compile.lll', call: 'eth_compileLLL', - params: 1, - inputFormatter: utils.toHex + params: 1 }); var compileSerpent = new Method({ name: 'compile.serpent', call: 'eth_compileSerpent', - params: 1, - inputFormatter: utils.toHex + params: 1 }); var flush = new Method({ diff --git a/test/FakeHttpProvider.js b/test/FakeHttpProvider.js deleted file mode 100644 index 70028ec..0000000 --- a/test/FakeHttpProvider.js +++ /dev/null @@ -1,58 +0,0 @@ -var chai = require('chai'); -var assert = require('assert'); -var utils = require('../lib/utils/utils'); - -var getResponseStub = function () { - return { - jsonrpc: '2.0', - id: 1, - result: 0 - }; -}; - -var FakeHttpProvider = function () { - this.response = getResponseStub(); - this.error = null; - this.validation = null; -}; - -FakeHttpProvider.prototype.send = function (payload) { - assert.equal(utils.isArray(payload) || utils.isObject(payload), true); - // TODO: validate jsonrpc request - if (this.error) { - throw this.error; - } - if (this.validation) { - this.validation(payload); - } - return this.response; -}; - -FakeHttpProvider.prototype.sendAsync = function (payload, callback) { - assert.equal(utils.isArray(payload) || utils.isObject(payload), true); - assert.equal(utils.isFunction(callback), true); - if (this.validation) { - this.validation(payload, callback); - } - callback(this.error, this.response); -}; - -FakeHttpProvider.prototype.injectResponse = function (response) { - this.response = response; -}; - -FakeHttpProvider.prototype.injectResult = function (result) { - this.response = getResponseStub(); - this.response.result = result; -}; - -FakeHttpProvider.prototype.injectError = function (error) { - this.error = error; -}; - -FakeHttpProvider.prototype.injectValidation = function (callback) { - this.validation = callback; -}; - -module.exports = FakeHttpProvider; -