web3.js/test/formatters.outputTransactio...

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-02-26 07:20:46 -08:00
var assert = require('assert');
2015-03-08 10:31:08 -07:00
var formatters = require('../lib/web3/formatters.js');
2015-02-26 07:20:46 -08:00
var BigNumber = require('bignumber.js');
describe('formatters', function () {
describe('outputTransactionFormatter', function () {
it('should return the correct value', function () {
assert.deepEqual(formatters.outputTransactionFormatter({
input: '0x34234kjh23kj4234',
from: '0x00000',
to: '0x00000',
value: '0x3e8',
gas: '0x3e8',
2015-03-23 10:50:33 -07:00
gasPrice: '0x3e8',
2015-04-20 10:52:43 -07:00
nonce: '0xb',
2015-03-23 10:50:33 -07:00
transactionIndex: '0x1',
blockNumber: '0x3e8',
blockHash: '0x34234bf23bf4234'
2015-02-26 07:20:46 -08:00
}), {
input: '0x34234kjh23kj4234',
from: '0x00000',
to: '0x00000',
value: new BigNumber(1000),
gas: 1000,
gasPrice: new BigNumber(1000),
2015-04-20 10:52:43 -07:00
nonce: 11,
2015-03-23 10:50:33 -07:00
blockNumber: 1000,
blockHash: '0x34234bf23bf4234',
transactionIndex: 1
2015-02-26 07:20:46 -08:00
});
});
});
2015-03-08 10:18:52 -07:00
});