From 5a15b8567550ef0b2382fae16a0965ddafa612af Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 26 Jun 2019 15:01:01 +0300 Subject: [PATCH 1/2] sort block after query --- apps/explorer/lib/explorer/counters/average_block_time.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/counters/average_block_time.ex b/apps/explorer/lib/explorer/counters/average_block_time.ex index 6db9caf8f6..450d6b8fb0 100644 --- a/apps/explorer/lib/explorer/counters/average_block_time.ex +++ b/apps/explorer/lib/explorer/counters/average_block_time.ex @@ -66,13 +66,14 @@ defmodule Explorer.Counters.AverageBlockTime do from(block in Block, limit: 100, offset: 0, - order_by: [desc: block.number, desc: block.timestamp], + order_by: [desc: block.number], select: {block.number, block.timestamp} ) timestamps = timestamps_query |> Repo.all() + |> Enum.sort_by(fn {_, timestamp} -> timestamp end, &>=/2) |> Enum.map(fn {number, timestamp} -> {number, DateTime.to_unix(timestamp, :millisecond)} end) From 41c92806fd892b20dc925eb1d64e623035e7a1e6 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 28 Jun 2019 11:44:59 +0300 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecd8e613a7..c85fd9904c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ - [#2167](https://github.com/poanetwork/blockscout/pull/2167) - feat: document eth rpc api mimicking endpoints - [#2225](https://github.com/poanetwork/blockscout/pull/2225) - fix metadata decoding in Solidity 0.5.9 smart contract verification - [#2204](https://github.com/poanetwork/blockscout/pull/2204) - fix large contract verification +- [#2248](https://github.com/poanetwork/blockscout/pull/2248) - sort block after query execution for average block time ### Chore - [#2127](https://github.com/poanetwork/blockscout/pull/2127) - use previouse chromedriver version