Skip to content

Commit

Permalink
fix: watched keys without labels
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Jun 25, 2024
1 parent d8f8177 commit 866a98f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions eth_validator_watcher/watched_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ def process_config(self, config: WatchedKeyConfig):
Parameters:
config: New configuration
"""
# Even if there is no label in the config, we consider the
# validator as watched. This method is only called for
# validators that are watched.
labels = [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_WATCHED]
if config.labels:
self._v.labels = config.labels + [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_WATCHED]
else:
self._v.labels = [LABEL_SCOPE_ALL_NETWORK, LABEL_SCOPE_NETWORK]
labels = labels + config.labels

self._v.labels = labels

def process_epoch(self, validator: Validators.DataItem):
"""Processes a new epoch.
Expand Down Expand Up @@ -203,7 +207,7 @@ def get_validators(self) -> dict[int, WatchedValidator]:
return self._validators

def process_config(self, config: Config):
"""Process a config update
"""Process a config update.
Parameters:
config: Updated configuration
Expand Down

0 comments on commit 866a98f

Please sign in to comment.