Skip to content

Commit

Permalink
Merge pull request #304 from lidofinance/accounting-tests-fix
Browse files Browse the repository at this point in the history
fix accounting tests not preparing csm depositable keys if there is a…
  • Loading branch information
avsetsin authored Oct 25, 2024
2 parents 8b814d5 + 8c63308 commit 7d31bb6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/regression/test_accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,13 +1086,14 @@ def _fill_csm_module_if_empty():
staking_modules = contracts.staking_router.getAllStakingModuleDigests()
assert len(staking_modules) == 3, "Modules count mismatch"

def operators_count(digest):
return digest[0]
def active_keys_count(digest):
# total deposited - total exited
return digest[3][1] - digest[3][0]

assert operators_count(staking_modules[0]) > 0, "NOR module empty"
assert operators_count(staking_modules[1]) > 0, "Simple DVT module empty"
assert active_keys_count(staking_modules[0]) > 0, "NOR module empty"
assert active_keys_count(staking_modules[1]) > 0, "Simple DVT module empty"

if operators_count(staking_modules[2]) == 0:
if active_keys_count(staking_modules[2]) == 0:
keys_count = 5
address, proof = get_ea_member()
csm_add_node_operator(contracts.csm, contracts.cs_accounting, address, proof, keys_count)
Expand Down

0 comments on commit 7d31bb6

Please sign in to comment.