You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
907 B

var assert = require('assert');
var formatters = require('../lib/web3/formatters.js');
describe('formatters', function () {
describe('outputPostFormatter', function () {
it('should return the correct value', function () {
assert.deepEqual(formatters.outputPostFormatter({
expiry: '0x3e8',
sent: '0x3e8',
ttl: '0x3e8',
workProved: '0x3e8',
payload: '0x7b2274657374223a2274657374227d',
topics: ['0x68656c6c6f','0x6d79746f70696373']
}), {
expiry: 1000,
sent: 1000,
ttl: 1000,
workProved: 1000,
payload: {test: 'test'},
payloadRaw: '0x7b2274657374223a2274657374227d',
topics: ['hello','mytopics']
});
});
});
});