From aa5d639e7244fbce2b87546618df270bf0e6b664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:48:54 -0300 Subject: [PATCH] Recompile configs and presets on file change --- lib/chain_spec/configs/mainnet.ex | 5 ++++- lib/chain_spec/configs/minimal.ex | 5 ++++- lib/chain_spec/configs/sepolia.ex | 5 ++++- lib/chain_spec/presets/mainnet.ex | 5 ++++- lib/chain_spec/presets/minimal.ex | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/chain_spec/configs/mainnet.ex b/lib/chain_spec/configs/mainnet.ex index 8cc01779e..9d1cdf265 100644 --- a/lib/chain_spec/configs/mainnet.ex +++ b/lib/chain_spec/configs/mainnet.ex @@ -2,8 +2,11 @@ defmodule MainnetConfig do @moduledoc """ Mainnet config constants. """ + file = "config/networks/mainnet/config.yaml" - @parsed_config ConfigUtils.load_config_from_file!("config/networks/mainnet/config.yaml") + @external_resource file + + @parsed_config ConfigUtils.load_config_from_file!(file) @unified Map.merge(MainnetPreset.get_preset(), @parsed_config) def get(key), do: Map.fetch!(@unified, key) diff --git a/lib/chain_spec/configs/minimal.ex b/lib/chain_spec/configs/minimal.ex index ebad450bf..2348c2ace 100644 --- a/lib/chain_spec/configs/minimal.ex +++ b/lib/chain_spec/configs/minimal.ex @@ -2,8 +2,11 @@ defmodule MinimalConfig do @moduledoc """ Minimal config constants. """ + file = "config/networks/minimal/config.yaml" - @parsed_config ConfigUtils.load_config_from_file!("config/networks/minimal/config.yaml") + @external_resource file + + @parsed_config ConfigUtils.load_config_from_file!(file) @unified Map.merge(MinimalPreset.get_preset(), @parsed_config) def get(key), do: Map.fetch!(@unified, key) diff --git a/lib/chain_spec/configs/sepolia.ex b/lib/chain_spec/configs/sepolia.ex index 9038986bd..10cf1f8d9 100644 --- a/lib/chain_spec/configs/sepolia.ex +++ b/lib/chain_spec/configs/sepolia.ex @@ -2,8 +2,11 @@ defmodule SepoliaConfig do @moduledoc """ Sepolia config constants. """ + file = "config/networks/sepolia/config.yaml" - @parsed_config ConfigUtils.load_config_from_file!("config/networks/sepolia/config.yaml") + @external_resource file + + @parsed_config ConfigUtils.load_config_from_file!(file) @unified Map.merge(MainnetPreset.get_preset(), @parsed_config) def get(key), do: Map.fetch!(@unified, key) diff --git a/lib/chain_spec/presets/mainnet.ex b/lib/chain_spec/presets/mainnet.ex index aea3c901e..e83f7d8ba 100644 --- a/lib/chain_spec/presets/mainnet.ex +++ b/lib/chain_spec/presets/mainnet.ex @@ -3,7 +3,10 @@ defmodule MainnetPreset do Mainnet preset constants. """ - @parsed_preset ConfigUtils.load_preset_from_dir!("config/presets/mainnet") + file = "config/presets/mainnet" + @external_resource file + + @parsed_preset ConfigUtils.load_preset_from_dir!(file) def get_preset, do: @parsed_preset end diff --git a/lib/chain_spec/presets/minimal.ex b/lib/chain_spec/presets/minimal.ex index f40698004..2a5352276 100644 --- a/lib/chain_spec/presets/minimal.ex +++ b/lib/chain_spec/presets/minimal.ex @@ -3,7 +3,10 @@ defmodule MinimalPreset do Minimal preset constants. """ - @parsed_preset ConfigUtils.load_preset_from_dir!("config/presets/minimal") + file = "config/presets/minimal" + @external_resource file + + @parsed_preset ConfigUtils.load_preset_from_dir!(file) def get_preset, do: @parsed_preset end