Fixed function nil.number_of_transactions/0 is undefined in tests

pull/2404/head
slightlycyborg 5 years ago
parent e9ac019d70
commit bb9e32e8bd
  1. 8
      apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex

@ -28,6 +28,14 @@ defmodule BlockScoutWeb.ChainController do
transaction_stats = get_transaction_stats() transaction_stats = get_transaction_stats()
# Hack for render during testing
transaction_stats =
if length(transaction_stats) == 0 do
[%{number_of_transactions: 0}]
else
transaction_stats
end
chart_data_paths = %{ chart_data_paths = %{
market: market_history_chart_path(conn, :show), market: market_history_chart_path(conn, :show),
transaction: transaction_history_chart_path(conn, :show) transaction: transaction_history_chart_path(conn, :show)

Loading…
Cancel
Save