Skip to content

Commit d4f09ab

Browse files
committed
small fixes
1 parent 18038d7 commit d4f09ab

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

scripts/vote_2026_01_26_hoodi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Voting 26/01/2026. Hoodi network.
33
4-
1. Grant MANAGE_SIGNING_KEYS role for operator 0x031624fAD4E9BFC2524e7a87336C4b190E70BCA8 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi
4+
1. Grant MANAGE_SIGNING_KEYS role for operator ID = 1 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi
55
66
# TODO (after vote) Vote #{vote number} passed & executed on ${date+time}, block ${blockNumber}.
77
"""
@@ -23,15 +23,15 @@
2323

2424

2525
# ============================= Description ==================================
26-
IPFS_DESCRIPTION = "Grant MANAGE_SIGNING_KEYS role for operator 0x031624fAD4E9BFC2524e7a87336C4b190E70BCA8 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi"
26+
IPFS_DESCRIPTION = "Grant MANAGE_SIGNING_KEYS role for operator ID = 1 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi"
2727

2828

2929
def get_vote_items() -> Tuple[List[str], List[Tuple[str, str]]]:
3030
params = [Param(0, Op.EQ, ArgumentValue(OPERATOR_ID))]
3131

3232
vote_desc_items, call_script_items = zip(
3333
(
34-
"1. Grant MANAGE_SIGNING_KEYS role for operator 0x031624fAD4E9BFC2524e7a87336C4b190E70BCA8 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi",
34+
"1. Grant MANAGE_SIGNING_KEYS role for operator ID = 1 to 0xc8195bb2851d7129D9100af9d65Bd448A6dE11eF on Hoodi",
3535
encode_permission_grant_p(
3636
target_app=TARGET_NO_REGISTRY,
3737
permission_name="MANAGE_SIGNING_KEYS",

tests/test_2026_01_26_hoodi.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
IPFS_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+
97115
def 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-
138137
def add_signing_keys_to_notallowed_operator_fails(accounts):
139138
no = interface.SimpleDVT(TARGET_NO_REGISTRY)
140139

0 commit comments

Comments
 (0)