Skip to content

Commit

Permalink
feat: make BeaconType compulsory with a default value
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Nov 21, 2023
1 parent c0b5502 commit 2be0482
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions eth_validator_watcher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config(BaseSettings):
model_config = SettingsConfigDict(case_sensitive=True, env_prefix='eth_watcher_')

beacon_url: Optional[str] = None
beacon_type: Optional[BeaconType] = None
beacon_type: BeaconType = BeaconType.OTHER
execution_url: Optional[str] = None
web3signer_url: Optional[str] = None
default_fee_recipient: Optional[str] = None
Expand All @@ -46,7 +46,7 @@ def load_config(config_file: str) -> Config:
"""
with open(config_file, 'r') as fh:
config = yaml.safe_load(fh)

from_env = Config().model_dump()
from_yaml = Config(**config).model_dump()

Expand Down
2 changes: 1 addition & 1 deletion tests/config/assets/config.empty.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
beacon_url: ~
beacon_type: ~
beacon_type: other
execution_url: ~
web3signer_url: ~
default_fee_recipient: ~
Expand Down
2 changes: 1 addition & 1 deletion tests/config/test_load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_empty_config() -> None:
assert config.default_fee_recipient is None
assert config.slack_channel is None
assert config.slack_token is None
assert config.beacon_type is None
assert config.beacon_type == BeaconType.OTHER
assert config.relays is None
assert config.liveness_file is None
assert config.watched_keys is None
Expand Down

0 comments on commit 2be0482

Please sign in to comment.