web3.js/test/method.request.js

24 lines
738 B
JavaScript
Raw Normal View History

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,
params: ['0x0000000000000000000000000000000000000000', 'latest'],
2015-05-12 05:01:33 +00:00
};
var request = web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback);
expected.format = request.format;
2015-05-12 05:01:33 +00:00
assert.deepEqual(request, expected);
});
});
});