forked from web3/web3.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatters.inputPostFormatter.js
More file actions
31 lines (27 loc) · 1010 Bytes
/
formatters.inputPostFormatter.js
File metadata and controls
31 lines (27 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var chai = require('chai');
var assert = chai.assert;
var formatters = require('../packages/web3-core-helpers/src/formatters.js');
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',
payload: '0x7b2274657374223a2274657374227d',//{test: 'test'},
ttl: 200,
priority: 1000,
topics: ['hello','mytopics'],
"workToProve": 1
}), {
from: '0x00000',
to: '0x00000',
payload: '0x7b2274657374223a2274657374227d',
ttl: '0xc8',
priority: '0x3e8',
topics: ['0x68656c6c6f','0x6d79746f70696373'],
workToProve: '0x1'
});
});
});
});