mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 19:48:13 +00:00
add formatter for syncing States (#482)
This commit is contained in:
parent
c2426ad880
commit
b489f5e24b
@ -277,6 +277,10 @@ var outputSyncingFormatter = function(result) {
|
|||||||
result.startingBlock = utils.toDecimal(result.startingBlock);
|
result.startingBlock = utils.toDecimal(result.startingBlock);
|
||||||
result.currentBlock = utils.toDecimal(result.currentBlock);
|
result.currentBlock = utils.toDecimal(result.currentBlock);
|
||||||
result.highestBlock = utils.toDecimal(result.highestBlock);
|
result.highestBlock = utils.toDecimal(result.highestBlock);
|
||||||
|
if (result.knownStates) {
|
||||||
|
result.knownStates = utils.toDecimal(result.knownStates);
|
||||||
|
result.pulledStates = utils.toDecimal(result.pulledStates);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -19,6 +19,24 @@ var tests = [{
|
|||||||
highestBlock: 11
|
highestBlock: 11
|
||||||
},
|
},
|
||||||
call: 'eth_syncing'
|
call: 'eth_syncing'
|
||||||
|
}, {
|
||||||
|
args: [],
|
||||||
|
formattedArgs: [],
|
||||||
|
result: [{
|
||||||
|
startingBlock: '0xb',
|
||||||
|
currentBlock: '0xb',
|
||||||
|
highestBlock: '0xb',
|
||||||
|
knownStates: '0xb',
|
||||||
|
pulledStates: '0xb'
|
||||||
|
}],
|
||||||
|
formattedResult: {
|
||||||
|
startingBlock: 11,
|
||||||
|
currentBlock: 11,
|
||||||
|
highestBlock: 11,
|
||||||
|
knownStates: 11,
|
||||||
|
pulledStates: 11
|
||||||
|
},
|
||||||
|
call: 'eth_syncing'
|
||||||
}];
|
}];
|
||||||
|
|
||||||
describe('eth', function () {
|
describe('eth', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user