web3.js/test/formatters.inputPostFormatt...

29 lines
916 B
JavaScript
Raw Normal View History

2015-03-07 10:18:22 -08:00
var chai = require('chai');
2015-03-08 10:18:52 -07:00
var formatters = require('../lib/solidity/formatters.js');
2015-03-07 10:18:22 -08:00
var assert = chai.assert;
2015-02-27 03:41:07 -08:00
describe('formatters', function () {
describe('inputPostFormatter', function () {
it('should return the correct value', function () {
// input as strings and numbers
assert.deepEqual(formatters.inputPostFormatter({
from: '0x00000',
to: '0x00000',
2015-03-07 10:18:22 -08:00
payload: JSON.stringify({test: 'test'}),
2015-02-27 03:41:07 -08:00
ttl: 200,
workToProve: 1000,
topic: ['hello','mytopics']
}), {
from: '0x00000',
to: '0x00000',
payload: '0x7b2274657374223a2274657374227d',
ttl: '0xc8',
workToProve: '0x3e8',
topic: ['0x68656c6c6f','0x6d79746f70696373']
});
});
});
2015-03-07 10:18:22 -08:00
});