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