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

31 lines
929 B
JavaScript
Raw Normal View History

2015-03-07 10:18:22 -08:00
var chai = require('chai');
var assert = chai.assert;
2015-03-22 01:43:07 -07:00
var formatters = require('../lib/web3/formatters.js');
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
2015-03-23 05:42:36 -07:00
assert.deepEqual(formatters.inputPostFormatter({
2015-02-27 03:41:07 -08:00
from: '0x00000',
to: '0x00000',
2015-03-09 07:09:21 -07:00
payload: {test: 'test'},
2015-02-27 03:41:07 -08:00
ttl: 200,
2015-03-10 09:27:36 -07:00
priority: 1000,
2015-03-10 08:22:16 -07:00
topics: ['hello','mytopics']
2015-03-23 05:42:36 -07:00
}), {
2015-02-27 03:41:07 -08:00
from: '0x00000',
to: '0x00000',
payload: '0x7b2274657374223a2274657374227d',
ttl: '0xc8',
2015-03-10 09:27:36 -07:00
priority: '0x3e8',
2015-04-16 03:22:06 -07:00
topics: ['0x68656c6c6f','0x6d79746f70696373'],
workToProve: '0x0'
2015-03-23 05:42:36 -07:00
});
2015-02-27 03:41:07 -08:00
});
});
2015-03-07 10:18:22 -08:00
});
2015-03-22 01:43:07 -07:00