2015-02-27 12:41:07 +01:00
|
|
|
var assert = require('assert');
|
2017-01-26 10:24:14 +01:00
|
|
|
var formatters = require('../packages/web3-core-helpers/src/formatters.js');
|
2015-02-27 12:41:07 +01:00
|
|
|
|
|
|
|
describe('formatters', function () {
|
|
|
|
describe('outputPostFormatter', function () {
|
|
|
|
it('should return the correct value', function () {
|
2016-10-07 13:07:42 +02:00
|
|
|
|
2015-02-27 12:41:07 +01:00
|
|
|
assert.deepEqual(formatters.outputPostFormatter({
|
|
|
|
expiry: '0x3e8',
|
|
|
|
sent: '0x3e8',
|
|
|
|
ttl: '0x3e8',
|
2015-03-10 17:27:36 +01:00
|
|
|
workProved: '0x3e8',
|
2015-02-27 12:41:07 +01:00
|
|
|
payload: '0x7b2274657374223a2274657374227d',
|
2016-10-07 13:07:42 +02:00
|
|
|
topics: ['0x68656c6c6f','0x6d79746f70696373']
|
2015-02-27 12:41:07 +01:00
|
|
|
}), {
|
|
|
|
expiry: 1000,
|
|
|
|
sent: 1000,
|
|
|
|
ttl: 1000,
|
2015-03-10 17:27:36 +01:00
|
|
|
workProved: 1000,
|
2016-01-21 15:25:44 +01:00
|
|
|
payload: '0x7b2274657374223a2274657374227d', //{test: 'test'},
|
|
|
|
// payloadRaw: '0x7b2274657374223a2274657374227d',
|
2015-03-10 16:22:16 +01:00
|
|
|
topics: ['hello','mytopics']
|
2015-02-27 12:41:07 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2015-03-08 18:18:52 +01:00
|
|
|
});
|