Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
allenan committed Sep 17, 2019
1 parent 9fc85d5 commit cbeed65
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions lib/blockchain_api/query/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule BlockchainAPI.Query.Stats do
"total" => get_supply()
},
"block_time" => %{
"24h" => get_query_by_shift(&query_block_interval/2, hours: -24),
"24h" => get_block_time(hours: -24),
"7d" => get_block_time(days: -7),
"30d" => get_block_time(days: -30)
},
Expand Down Expand Up @@ -260,18 +260,6 @@ defmodule BlockchainAPI.Query.Stats do
end)
end

# select * from poc_witnesses pw
# inner join poc_path_elements pe
# on pe.id = pw.poc_path_elements_id
# inner join poc_receipts_transactions rt
# on rt.hash = pe.poc_receipts_transactions_hash
# inner join transactions tx
# on tx.hash = rt.hash
# inner join blocks b
# on b.height = tx.block_height
# WHERE (b.time >= 1568156776) AND (b.time <= 1568243176)
# order by pw.distance desc, b.time asc

defp query_farthest_witness(start, finish) do
distance_query =
from(
Expand Down Expand Up @@ -315,7 +303,7 @@ defmodule BlockchainAPI.Query.Stats do

query
|> Repo.all()
|> Enum.map(fn %{gateway: gateway, owner: owner} = m ->
|> Enum.map(fn %{gateway: gateway} = m ->
m
|> Map.put(:gateway, Util.bin_to_string(gateway))
end)
Expand Down

0 comments on commit cbeed65

Please sign in to comment.