|
|
|
@ -3,8 +3,6 @@ defmodule Explorer.Chain.Cache.NetVersion do |
|
|
|
|
Caches chain version. |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
@json_rpc_named_arguments Application.get_env(:explorer, :json_rpc_named_arguments) |
|
|
|
|
|
|
|
|
|
require Logger |
|
|
|
|
|
|
|
|
|
use Explorer.Chain.MapCache, |
|
|
|
@ -12,7 +10,7 @@ defmodule Explorer.Chain.Cache.NetVersion do |
|
|
|
|
key: :version |
|
|
|
|
|
|
|
|
|
defp handle_fallback(:version) do |
|
|
|
|
case EthereumJSONRPC.fetch_net_version(@json_rpc_named_arguments) do |
|
|
|
|
case EthereumJSONRPC.fetch_net_version(Application.get_env(:explorer, :json_rpc_named_arguments)) do |
|
|
|
|
{:ok, value} -> |
|
|
|
|
{:update, value} |
|
|
|
|
|
|
|
|
|