web3.js/test/web3.eth.getBalance.js
Fabian Vogelsteller bbfefb091c Modularize web3.js (#541)
* added sub packages

* added lerna monopackage management

* check for package is instance

* added method, subscription and utils package

* moved almost all packages

* moved all packages, no umbrella package yet

* added extend to packages

* made contract pass

* made batch tests pass

* expose providers

* fixed test async

* fixed test errors

* fixed test event encode decode

* fixed test formatter tests

* fixed method tests

* fixed method utils

* fixed some eth methods

* fixed some eth methods 2

* bumped version 0.18.3 to republish meteor package

* fixed get* tests

* fixed subscribe tests

* added newBlockHeaders subscription

* remove unpublished package from package.json

* added sendTransaction test

* fixed call test

* moved files to done

* changed extend

* added iban tests

* Fixed ALL tests

* Fixed lint tests

* Fixed contract tests

* added method tests

* added more method tests to test promiEvents extensively

* added confirmation event

* improved method confirmation checking
2017-01-26 10:24:14 +01:00

85 lines
2.8 KiB
JavaScript

var testMethod = require('./helpers/test.method.js');
var Eth = require('../packages/web3-eth');
var eth = new Eth();
var method = 'getBalance';
var tests = [{
args: ['0x000000000000000000000000000000000000012d', 2],
formattedArgs: ['0x000000000000000000000000000000000000012d', '0x2'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
},{
args: ['0x000000000000000000000000000000000000012d', '0x1'],
formattedArgs: ['0x000000000000000000000000000000000000012d', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0x000000000000000000000000000000000000012d', 0x1],
formattedArgs: ['0x000000000000000000000000000000000000012d', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0x000000000000000000000000000000000000012d'],
formattedArgs: ['0x000000000000000000000000000000000000012d', eth.defaultBlock],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0XDBDBDB2CBD23B783741E8D7FCF51E459B497E4A6', 0x1],
formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0xdbdbdB2cBD23b783741e8d7fcF51e459b497e4a6', 0x1], // checksum address
formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
},
{
args: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', 0x1],
formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['dbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', 0x1],
formattedArgs: ['0xdbdbdb2cbd23b783741e8d7fcf51e459b497e4a6', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0x000000000000000000000000000000000000012d', 0x1],
formattedArgs: ['0x000000000000000000000000000000000000012d', '0x1'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['0x000000000000000000000000000000000000012d'],
formattedArgs: ['0x000000000000000000000000000000000000012d', 'latest'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['000000000000000000000000000000000000012d'],
formattedArgs: ['0x000000000000000000000000000000000000012d', 'latest'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}, {
args: ['XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS'], // iban address
formattedArgs: ['0x00c5496aee77c1ba1f0854206a26dda82a81d6d8', 'latest'],
result: '0x31981',
formattedResult: '203137',
call: 'eth_'+ method
}];
testMethod.runTests('eth', method, tests);