Skip to content

Commit

Permalink
feat(val-1404): make linter happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
dputko committed Jan 15, 2025
1 parent c25dc57 commit 1ca7458
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions tests/execution_requests/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class WatcherStub:
valid_withdrawal_addresses: set[str]

def __init__(
self,
user_keys: dict[str, NamedKey] = None,
indexed_validators_keys: dict[str, str] = None,
valid_withdrawal_addresses: set[str] = None,
self,
user_keys: dict[str, NamedKey] = None,
indexed_validators_keys: dict[str, str] = None,
valid_withdrawal_addresses: set[str] = None,
):
self.alertmanager = AlertmanagerStub()
self.user_keys = user_keys or {}
Expand Down
2 changes: 1 addition & 1 deletion tests/execution_requests/test_consolidations.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_group_similar_alerts(user_validator: TestValidator, watcher: WatcherStu
source_address=random_source_address,
source_pubkey=user_validator.pubkey,
target_pubkey=random_target_pubkey2,
)
),
]
)
handler = ConsolidationHandler()
Expand Down
20 changes: 9 additions & 11 deletions tests/execution_requests/test_withdrawals.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def test_from_user_withdrawal_address(validator: TestValidator, withdrawal_addre
assert alert.labels.alertname.startswith('HeadWatcherELWithdrawalFromUserWithdrawalAddress')
assert alert.labels.severity == 'critical'
assert (
alert.annotations.summary
== "πŸ”—β€πŸƒπŸšͺOur validator triggered withdrawal was requested from our Withdrawal Vault address"
alert.annotations.summary
== "πŸ”—β€πŸƒπŸšͺOur validator triggered withdrawal was requested from our Withdrawal Vault address"
)
assert validator.pubkey in alert.annotations.description
assert withdrawal_address in alert.annotations.description
Expand Down Expand Up @@ -112,14 +112,12 @@ def test_group_similar_alerts():
withdrawal_address = gen_random_address()

watcher = WatcherStub(

user_keys={
validator1.pubkey: NamedKey(operatorName='test operator', key=validator1.pubkey, operatorIndex='1',
moduleIndex='1')
validator1.pubkey: NamedKey(
operatorName='test operator', key=validator1.pubkey, operatorIndex='1', moduleIndex='1'
)
},
valid_withdrawal_addresses={
withdrawal_address
}
valid_withdrawal_addresses={withdrawal_address},
)
block = create_sample_block(
withdrawals=[
Expand All @@ -132,7 +130,7 @@ def test_group_similar_alerts():
source_address=withdrawal_address,
validator_pubkey=validator2.pubkey,
amount='32',
)
),
]
)
handler = ElTriggeredExitHandler()
Expand All @@ -145,8 +143,8 @@ def test_group_similar_alerts():
assert alert.labels.alertname.startswith('HeadWatcherELWithdrawalFromUserWithdrawalAddress')
assert alert.labels.severity == 'critical'
assert (
alert.annotations.summary
== "πŸ”—β€πŸƒπŸšͺOur validator triggered withdrawal was requested from our Withdrawal Vault address"
alert.annotations.summary
== "πŸ”—β€πŸƒπŸšͺOur validator triggered withdrawal was requested from our Withdrawal Vault address"
)
assert validator1.pubkey in alert.annotations.description
assert validator2.pubkey in alert.annotations.description
Expand Down

0 comments on commit 1ca7458

Please sign in to comment.