2015-05-12 05:01:33 +00:00
|
|
|
var chai = require('chai');
|
|
|
|
var assert = chai.assert;
|
|
|
|
var web3 = require('../index');
|
|
|
|
|
|
|
|
describe('lib/web3/method', function () {
|
|
|
|
describe('request', function () {
|
|
|
|
it('should create proper request', function () {
|
|
|
|
|
|
|
|
var callback = function (err, result) {};
|
|
|
|
var expected = {
|
|
|
|
method: 'eth_getBalance',
|
|
|
|
callback: callback,
|
2015-05-12 05:50:58 +00:00
|
|
|
params: ['0x0000000000000000000000000000000000000000', 'latest'],
|
2015-05-12 05:01:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var request = web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback);
|
2015-05-12 05:50:58 +00:00
|
|
|
|
|
|
|
expected.format = request.format;
|
2015-05-12 05:01:33 +00:00
|
|
|
assert.deepEqual(request, expected);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|