web3.js/test/formatters.inputTransactionFormatter.js

28 lines
868 B
JavaScript
Raw Normal View History

2015-03-22 09:43:07 +01:00
var chai = require('chai');
var assert = chai.assert;
2015-03-08 18:31:08 +01:00
var formatters = require('../lib/web3/formatters.js');
2015-02-26 15:54:49 +01:00
var BigNumber = require('bignumber.js');
describe('formatters', function () {
describe('inputTransactionFormatter', function () {
it('should return the correct value', function () {
2015-03-23 13:42:36 +01:00
assert.deepEqual(formatters.inputTransactionFormatter({
2015-03-23 18:50:33 +01:00
data: '0x34234bf23bf4234',
2015-02-26 15:54:49 +01:00
value: new BigNumber(100),
from: '0x00000',
to: '0x00000',
gas: 1000,
2015-03-23 18:50:33 +01:00
gasPrice: new BigNumber(1000)
2015-03-23 13:42:36 +01:00
}), {
2015-03-23 18:50:33 +01:00
data: '0x34234bf23bf4234',
2015-02-26 15:54:49 +01:00
value: '0x64',
from: '0x00000',
to: '0x00000',
gas: '0x3e8',
2015-03-23 18:50:33 +01:00
gasPrice: '0x3e8'
2015-03-23 13:42:36 +01:00
});
2015-02-26 15:54:49 +01:00
});
});
2015-03-08 18:18:52 +01:00
});