Skip to content

Commit

Permalink
fix: test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
krogla committed Feb 15, 2024
1 parent 545d17b commit 7821293
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion tests/regression/test_accounting_oracle_extra_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def extra_data_service():


def get_exited_count(node_operator_id):
no = contracts.node_operators_registry.getNodeOperator(node_operator_id, True)
no = contracts.node_operators_registry.getNodeOperator(node_operator_id, False)
return no["totalExitedValidators"]


Expand Down
4 changes: 2 additions & 2 deletions tests/regression/test_all_round_happy_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_all_round_happy_path(accounts, stranger, steth_holder, eth_whale):
penalized_node_operator_ids_nor = []

for i in range(nor_operators_count):
no = contracts.node_operators_registry.getNodeOperator(i, True)
no = contracts.node_operators_registry.getNodeOperator(i, False)
is_node_operator_penalized = contracts.node_operators_registry.isOperatorPenalized(i)
if is_node_operator_penalized:
penalized_node_operator_ids_nor.append(i)
Expand All @@ -143,7 +143,7 @@ def test_all_round_happy_path(accounts, stranger, steth_holder, eth_whale):

penalized_node_operator_ids_sdvt = []
for i in range(sdvt_operators_count):
no = contracts.simple_dvt.getNodeOperator(i, True)
no = contracts.simple_dvt.getNodeOperator(i, False)
is_node_operator_penalized = contracts.simple_dvt.isOperatorPenalized(i)
if is_node_operator_penalized:
penalized_node_operator_ids_sdvt.append(i)
Expand Down
28 changes: 14 additions & 14 deletions tests/regression/test_easy_track_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def test_add_node_operators():


def test_node_operators_activations():
assert contracts.simple_dvt.getNodeOperator(1, True)[0]
assert contracts.simple_dvt.getNodeOperator(2, True)[0]
assert contracts.simple_dvt.getNodeOperator(1, False)[0]
assert contracts.simple_dvt.getNodeOperator(2, False)[0]

deactivate_node_operator(
[
Expand All @@ -193,8 +193,8 @@ def test_node_operators_activations():
]
)

assert not contracts.simple_dvt.getNodeOperator(1, True)[0]
assert not contracts.simple_dvt.getNodeOperator(2, True)[0]
assert not contracts.simple_dvt.getNodeOperator(1, False)[0]
assert not contracts.simple_dvt.getNodeOperator(2, False)[0]

# ActivateNodeOperators
activate_node_operators(
Expand All @@ -210,13 +210,13 @@ def test_node_operators_activations():
]
)

assert contracts.simple_dvt.getNodeOperator(1, True)[0]
assert contracts.simple_dvt.getNodeOperator(2, True)[0]
assert contracts.simple_dvt.getNodeOperator(1, False)[0]
assert contracts.simple_dvt.getNodeOperator(2, False)[0]


def test_set_vetted_validators_limits():
op_1 = contracts.simple_dvt.getNodeOperator(1, True)
op_2 = contracts.simple_dvt.getNodeOperator(2, True)
op_1 = contracts.simple_dvt.getNodeOperator(1, False)
op_2 = contracts.simple_dvt.getNodeOperator(2, False)

new_vetted_keys_1 = random.randint(0, op_1[5])
new_vetted_keys_2 = random.randint(0, op_2[5])
Expand All @@ -234,8 +234,8 @@ def test_set_vetted_validators_limits():
]
)

assert contracts.simple_dvt.getNodeOperator(1, True)[3] == new_vetted_keys_1
assert contracts.simple_dvt.getNodeOperator(2, True)[3] == new_vetted_keys_2
assert contracts.simple_dvt.getNodeOperator(1, False)[3] == new_vetted_keys_1
assert contracts.simple_dvt.getNodeOperator(2, False)[3] == new_vetted_keys_2


def test_set_node_operator_names():
Expand Down Expand Up @@ -281,8 +281,8 @@ def test_set_node_operator_reward_addresses():
]
)

assert contracts.simple_dvt.getNodeOperator(1, True)[2] == address_1
assert contracts.simple_dvt.getNodeOperator(2, True)[2] == address_2
assert contracts.simple_dvt.getNodeOperator(1, False)[2] == address_1
assert contracts.simple_dvt.getNodeOperator(2, False)[2] == address_2


def test_update_target_validator_limits():
Expand All @@ -302,8 +302,8 @@ def test_update_target_validator_limits():
]
)

# assert contracts.simple_dvt.getNodeOperator(1, True)[1] == address_1
# assert contracts.simple_dvt.getNodeOperator(2, True)[2] == address_2
# assert contracts.simple_dvt.getNodeOperator(1, False)[1] == address_1
# assert contracts.simple_dvt.getNodeOperator(2, False)[2] == address_2


def test_transfer_node_operator_manager():
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/test_node_operators_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parse_pubkeys_batch,
parse_signatures_batch,
random_pubkeys_batch,
random_signatures_batch
random_signatures_batch,
)
from utils.test.node_operators_helpers import (
assert_signing_key,
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/test_staking_module_happy_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def calc_no_rewards(nor, no_id, minted_shares):

def set_staking_limit(nor, ops_ids, keys_count, impersonated_voting):
for op_index in ops_ids:
no = nor.getNodeOperator(op_index, True)
no = nor.getNodeOperator(op_index, False)
if not no["active"]:
continue
cur_deposited_keys = no["totalDepositedValidators"]
Expand Down Expand Up @@ -756,7 +756,7 @@ def module_happy_path(staking_module, extra_data_service, impersonated_voting, e
assert no3_deposited_keys_before != no3_deposited_keys_after

for op_index in (no1_id, no2_id, no3_id):
no = staking_module.getNodeOperator(op_index, True)
no = staking_module.getNodeOperator(op_index, False)
staking_module.setNodeOperatorStakingLimit(
op_index, no["totalDepositedValidators"] + 10, {"from": impersonated_voting}
)
Expand Down

0 comments on commit 7821293

Please sign in to comment.