3232IPFS_DESCRIPTION_HASH = "bafkreies4yycczkmfgwexirpnogbzlo7j262svtrwcj5k2x7ashyvhnaqm"
3333
3434
35- def test_vote_acceptance (helpers , accounts , ldo_holder , vote_ids_from_env ):
35+ def test_vote (helpers , accounts , ldo_holder , vote_ids_from_env ):
3636 voting = interface .Voting (VOTING )
3737 no = interface .NodeOperatorsRegistry (TARGET_NO_REGISTRY )
38+ perm_param = Param (0 , Op .EQ , ArgumentValue (OPERATOR_ID ))
39+ perm_param_uint = perm_param .to_uint256 ()
3840
3941 # =========================================================================
4042 # ======================== Identify or Create vote ========================
@@ -51,9 +53,6 @@ def test_vote_acceptance(helpers, accounts, ldo_holder, vote_ids_from_env):
5153 onchain_script = voting .getVote (vote_id )["script" ]
5254 assert str (onchain_script ).lower () == encode_call_script (call_script_items ).lower ()
5355
54- perm_param = Param (0 , Op .EQ , ArgumentValue (OPERATOR_ID ))
55- perm_param_uint = perm_param .to_uint256 ()
56-
5756 # =========================================================================
5857 # ============================= Execute Vote ==============================
5958 # =========================================================================
@@ -66,7 +65,7 @@ def test_vote_acceptance(helpers, accounts, ldo_holder, vote_ids_from_env):
6665 # Item 1
6766 assert no .getNodeOperator (OPERATOR_ID , True )["rewardAddress" ] == EXPECTED_REWARD_ADDRESS
6867 assert not no .canPerform (NEW_MANAGER_ADDRESS , MANAGE_SIGNING_KEYS , [perm_param_uint ])
69- # scenario reassurance tests
68+ # scenario test
7069 add_signing_keys_fails_before_vote (accounts )
7170
7271 assert get_lido_vote_cid_from_str (find_metadata_by_vote_id (vote_id )) == IPFS_DESCRIPTION_HASH
@@ -89,11 +88,30 @@ def test_vote_acceptance(helpers, accounts, ldo_holder, vote_ids_from_env):
8988 permission = Permission (entity = NEW_MANAGER_ADDRESS , app = no , role = MANAGE_SIGNING_KEYS )
9089 validate_permission_grantp_event (vote_events [0 ], permission , [perm_param ], emitted_by = ACL )
9190
92- # scenario happy path tests
91+ # scenario tests
9392 manager_adds_signing_keys (accounts )
9493 add_signing_keys_to_notallowed_operator_fails (accounts )
9594
9695
96+ def add_signing_keys_fails_before_vote (accounts ):
97+ no = interface .SimpleDVT (TARGET_NO_REGISTRY )
98+
99+ manager = accounts .at (NEW_MANAGER_ADDRESS , force = True )
100+ set_balance (manager , 10 )
101+
102+ pubkeys = random_pubkeys_batch (1 )
103+ signatures = random_signatures_batch (1 )
104+
105+ with reverts ():
106+ no .addSigningKeys (
107+ OPERATOR_ID ,
108+ 1 ,
109+ pubkeys ,
110+ signatures ,
111+ {"from" : manager },
112+ )
113+
114+
97115def manager_adds_signing_keys (accounts ):
98116 no = interface .SimpleDVT (TARGET_NO_REGISTRY )
99117
@@ -116,25 +134,6 @@ def manager_adds_signing_keys(accounts):
116134 assert total_keys_after == total_keys_before + 1
117135
118136
119- def add_signing_keys_fails_before_vote (accounts ):
120- no = interface .SimpleDVT (TARGET_NO_REGISTRY )
121-
122- manager = accounts .at (NEW_MANAGER_ADDRESS , force = True )
123- set_balance (manager , 10 )
124-
125- pubkeys = random_pubkeys_batch (1 )
126- signatures = random_signatures_batch (1 )
127-
128- with reverts ():
129- no .addSigningKeys (
130- OPERATOR_ID ,
131- 1 ,
132- pubkeys ,
133- signatures ,
134- {"from" : manager },
135- )
136-
137-
138137def add_signing_keys_to_notallowed_operator_fails (accounts ):
139138 no = interface .SimpleDVT (TARGET_NO_REGISTRY )
140139
0 commit comments