From e213551699cd10e6ef2f5fd7a43dbc6e01ad0ad8 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sun, 29 Mar 2015 21:54:53 +0200 Subject: [PATCH] tests for #144 --- test/web3.eth.defaultBlock.js | 12 ++++++++++++ test/web3.eth.getBalance.js | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/web3.eth.defaultBlock.js diff --git a/test/web3.eth.defaultBlock.js b/test/web3.eth.defaultBlock.js new file mode 100644 index 0000000..5fc60df --- /dev/null +++ b/test/web3.eth.defaultBlock.js @@ -0,0 +1,12 @@ +var chai = require('chai'); +var assert = chai.assert; +var web3 = require('../index'); + +describe('web3.eth', function () { + describe('defaultBlock', function () { + it('should check if defaultBlock is set to proper value', function () { + assert.equal(web3.eth.defaultBlock, 'latest'); + }); + }); +}); + diff --git a/test/web3.eth.getBalance.js b/test/web3.eth.getBalance.js index 9e9d110..890557e 100644 --- a/test/web3.eth.getBalance.js +++ b/test/web3.eth.getBalance.js @@ -28,6 +28,24 @@ var tests = [{ result: '0x31981', formattedResult: new BigNumber('0x31981', 16), call: 'eth_'+ method +}, { + args: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', 0x1], + formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'], + result: '0x31981', + formattedResult: new BigNumber('0x31981', 16), + call: 'eth_'+ method +}, { + args: ['1255171934823351805979544608257289442498956485798', 0x1], + formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'], + result: '0x31981', + formattedResult: new BigNumber('0x31981', 16), + call: 'eth_'+ method +}, { + args: ['1255171934823351805979544608257289442498956485798'], + formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', 'latest'], + result: '0x31981', + formattedResult: new BigNumber('0x31981', 16), + call: 'eth_'+ method }]; testMethod.runTests('eth', method, tests);