Modify gas price statistics (#2947)
* gas price distribution + median + tests * put histogram in util * use the util histogram * remove the default gas price implementation * histogram rpc * fix empty corpus * Add JS ethcore_gasPriceHistogram * Fix typo (s/types/type/) & subsequent failing test * Fix return type & formatting * bucketBounds * Add jsapi e2e test verification
This commit is contained in:
@@ -70,6 +70,20 @@ export function outDate (date) {
|
||||
return new Date(outNumber(date).toNumber() * 1000);
|
||||
}
|
||||
|
||||
export function outHistogram (histogram) {
|
||||
if (histogram) {
|
||||
Object.keys(histogram).forEach((key) => {
|
||||
switch (key) {
|
||||
case 'bucketBounds':
|
||||
case 'counts':
|
||||
histogram[key] = histogram[key].map(outNumber);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return histogram;
|
||||
}
|
||||
|
||||
export function outLog (log) {
|
||||
Object.keys(log).forEach((key) => {
|
||||
switch (key) {
|
||||
|
||||
Reference in New Issue
Block a user