web3.js/test/formatters.inputPostFormatter.js

32 lines
1010 B
JavaScript
Raw Normal View History

2015-03-07 19:18:22 +01:00
var chai = require('chai');
var assert = chai.assert;
var formatters = require('../packages/web3-core-helpers/src/formatters.js');
2015-02-27 12:41:07 +01:00
describe('formatters', function () {
describe('inputPostFormatter', function () {
it('should return the correct value', function () {
2015-02-27 12:41:07 +01:00
// input as strings and numbers
2015-03-23 13:42:36 +01:00
assert.deepEqual(formatters.inputPostFormatter({
2015-02-27 12:41:07 +01:00
from: '0x00000',
to: '0x00000',
2016-02-29 11:22:57 +01:00
payload: '0x7b2274657374223a2274657374227d',//{test: 'test'},
2015-02-27 12:41:07 +01:00
ttl: 200,
2015-03-10 17:27:36 +01:00
priority: 1000,
topics: ['hello','mytopics'],
"workToProve": 1
2015-03-23 13:42:36 +01:00
}), {
2015-02-27 12:41:07 +01:00
from: '0x00000',
to: '0x00000',
payload: '0x7b2274657374223a2274657374227d',
ttl: '0xc8',
2015-03-10 17:27:36 +01:00
priority: '0x3e8',
2015-04-16 12:22:06 +02:00
topics: ['0x68656c6c6f','0x6d79746f70696373'],
workToProve: '0x1'
2015-03-23 13:42:36 +01:00
});
2015-02-27 12:41:07 +01:00
});
});
2015-03-07 19:18:22 +01:00
});
2015-03-22 09:43:07 +01:00