do not try to parse data if there is none

pull/2505/head
Ayrat Badykov 5 years ago
parent e79ec41f5a
commit c58723f641
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 8
      apps/explorer/lib/explorer/chain_spec/parity/importer.ex

@ -51,15 +51,23 @@ defmodule Explorer.ChainSpec.Parity.Importer do
def genesis_coin_balances(chain_spec) do
accounts = chain_spec["accounts"]
if accounts do
parse_accounts(accounts)
else
Logger.warn(fn -> "No accounts are defined in chain spec" end)
end
end
def emission_rewards(chain_spec) do
rewards = chain_spec["engine"]["Ethash"]["params"]["blockReward"]
if rewards do
rewards
|> parse_hex_numbers()
|> format_ranges()
else
Logger.warn(fn -> "No rewards are defined in chain spec" end)
end
end
defp parse_accounts(accounts) do

Loading…
Cancel
Save