2015-02-26 15:20:46 +00:00
|
|
|
var assert = require('assert');
|
2015-03-08 17:31:08 +00:00
|
|
|
var formatters = require('../lib/web3/formatters.js');
|
2015-02-26 15:20:46 +00: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',
|
|
|
|
gasPrice: '0x3e8'
|
|
|
|
}), {
|
|
|
|
input: '0x34234kjh23kj4234',
|
|
|
|
from: '0x00000',
|
|
|
|
to: '0x00000',
|
|
|
|
value: new BigNumber(1000),
|
|
|
|
gas: 1000,
|
|
|
|
gasPrice: new BigNumber(1000),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2015-03-08 17:18:52 +00:00
|
|
|
});
|