aboutsummaryrefslogtreecommitdiffstats
path: root/formatters.outputBlockFormatter.js
blob: 27225065161246c1063da0e7d5ee6e9d181f2a4f (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var chai = require('chai');
var assert = chai.assert; 
var formatters = require('../lib/web3/formatters.js');
var BigNumber = require('bignumber.js');

describe('formatters', function () {
    describe('outputBlockFormatter', function () {
        it('should return the correct value', function () {
            
            assert.deepEqual(formatters.outputBlockFormatter({
                hash: '0x34234kjh23kj4234',
                parentHash: '0x34234kjh23kj4234',
                miner: '0x34234kjh23kj4234',
                stateRoot: '0x34234kjh23kj4234',
                sha3Uncles: '0x34234kjh23kj4234',
                bloom: '0x34234kjh23kj4234',
                difficulty: '0x3e8',
                totalDifficulty: '0x3e8',
                number: '0x3e8',
                gasLimit: '0x3e8',
                gasUsed: '0x3e8',
                timestamp: '0x3e8',
                extraData: '0x34234kjh23kj4234',
                nonce: '0x34234kjh23kj4234',
                children: ['0x34234kjh23kj4234'],
                size: '0x3e8'
            }), {
                hash: '0x34234kjh23kj4234',
                parentHash: '0x34234kjh23kj4234',
                miner: '0x34234kjh23kj4234',
                stateRoot: '0x34234kjh23kj4234',
                sha3Uncles: '0x34234kjh23kj4234',
                bloom: '0x34234kjh23kj4234',
                difficulty: new BigNumber(1000),
                totalDifficulty: new BigNumber(1000),
                number: 1000,
                gasLimit: 1000,
                gasUsed: 1000,
                timestamp: 1000,
                extraData: '0x34234kjh23kj4234',
                nonce: '0x34234kjh23kj4234',
                children: ['0x34234kjh23kj4234'],
                size: 1000
            });
        });
    });
});