@@ -17,12 +17,6 @@ defmodule BeaconApi.V1.ConfigController do
1717 ]
1818 @ chain_spec_hex_fields [
1919 "TERMINAL_BLOCK_HASH" ,
20- "GENESIS_FORK_VERSION" ,
21- "ALTAIR_FORK_VERSION" ,
22- "BELLATRIX_FORK_VERSION" ,
23- "CAPELLA_FORK_VERSION" ,
24- "DENEB_FORK_VERSION" ,
25- "ELECTRA_FORK_VERSION" ,
2620 "DEPOSIT_CONTRACT_ADDRESS" ,
2721 "MESSAGE_DOMAIN_INVALID_SNAPPY" ,
2822 "MESSAGE_DOMAIN_VALID_SNAPPY"
@@ -43,9 +37,17 @@ defmodule BeaconApi.V1.ConfigController do
4337 |> Map . drop ( @ chain_spec_removed_keys )
4438 |> rename_keys ( @ chain_spec_renamed_keys )
4539 |> Map . new ( fn
46- { k , v } when is_integer ( v ) -> { k , Integer . to_string ( v ) }
47- { k , v } when k in @ chain_spec_hex_fields -> { k , Utils . hex_encode ( v ) }
48- { k , v } -> { k , v }
40+ { k , v } when is_integer ( v ) ->
41+ { k , Integer . to_string ( v ) }
42+
43+ { k , v } when k in @ chain_spec_hex_fields ->
44+ { k , Utils . hex_encode ( v ) }
45+
46+ { k , v } when is_binary ( v ) ->
47+ if String . ends_with? ( k , "_FORK_VERSION" ) , do: { k , Utils . hex_encode ( v ) } , else: { k , v }
48+
49+ { k , v } ->
50+ { k , v }
4951 end )
5052 end
5153
0 commit comments