web3.js/test/formatters.inputTransaction...

27 lines
854 B
JavaScript
Raw Normal View History

2015-02-26 06:54:49 -08:00
var assert = require('assert');
2015-03-08 10:18:52 -07:00
var formatters = require('../lib/solidity/formatters.js');
2015-02-26 06:54:49 -08:00
var BigNumber = require('bignumber.js');
describe('formatters', function () {
describe('inputTransactionFormatter', function () {
it('should return the correct value', function () {
assert.deepEqual(formatters.inputTransactionFormatter({
data: '0x34234kjh23kj4234',
value: new BigNumber(100),
from: '0x00000',
to: '0x00000',
gas: 1000,
gasPrice: new BigNumber(1000),
}), {
data: '0x34234kjh23kj4234',
value: '0x64',
from: '0x00000',
to: '0x00000',
gas: '0x3e8',
gasPrice: '0x3e8',
});
});
});
2015-03-08 10:18:52 -07:00
});