add formatter for syncing States (#482)

This commit is contained in:
Marius Darila 2016-09-12 16:52:36 +03:00 committed by Fabian Vogelsteller
parent c2426ad880
commit b489f5e24b
2 changed files with 31 additions and 9 deletions

View File

@ -277,6 +277,10 @@ var outputSyncingFormatter = function(result) {
result.startingBlock = utils.toDecimal(result.startingBlock);
result.currentBlock = utils.toDecimal(result.currentBlock);
result.highestBlock = utils.toDecimal(result.highestBlock);
if (result.knownStates) {
result.knownStates = utils.toDecimal(result.knownStates);
result.pulledStates = utils.toDecimal(result.pulledStates);
}
return result;
};

View File

@ -19,6 +19,24 @@ var tests = [{
highestBlock: 11
},
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 () {