Snapshot sync and block gap info in eth_syncing (#2948)
* provide snapshot sync info in eth_syncing * specify block gap in eth_syncing * Extend eth_syncing with warp, format the output properly * adjust serialization tests for sync info * whitespace
This commit is contained in:
committed by
Gav Wood
parent
ff90fac125
commit
8599a11a0b
@@ -153,6 +153,28 @@ export function outSignerRequest (request) {
|
||||
return request;
|
||||
}
|
||||
|
||||
export function outSyncing (syncing) {
|
||||
if (syncing && syncing !== 'false') {
|
||||
Object.keys(syncing).forEach((key) => {
|
||||
switch (key) {
|
||||
case 'currentBlock':
|
||||
case 'highestBlock':
|
||||
case 'startingBlock':
|
||||
case 'warpChunksAmount':
|
||||
case 'warpChunksProcessed':
|
||||
syncing[key] = outNumber(syncing[key]);
|
||||
break;
|
||||
|
||||
case 'blockGap':
|
||||
syncing[key] = syncing[key].map(outNumber);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return syncing;
|
||||
}
|
||||
|
||||
export function outTransaction (tx) {
|
||||
if (tx) {
|
||||
Object.keys(tx).forEach((key) => {
|
||||
|
||||
Reference in New Issue
Block a user