Skip to content

Commit 39fb38e

Browse files
refactor: omit return_error_message param in sudo_set_admin_utils
1 parent 495d7fc commit 39fb38e

File tree

7 files changed

+3
-20
lines changed

7 files changed

+3
-20
lines changed

tests/e2e_tests/test_commit_reveal_v3.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ async def test_commit_and_reveal_weights_cr3(local_chain, subtensor, alice_walle
5959
alice_wallet,
6060
call_function="sudo_set_weights_set_rate_limit",
6161
call_params={"netuid": netuid, "weights_set_rate_limit": "0"},
62-
return_error_message=True,
6362
)
6463

6564
assert error is None
@@ -81,7 +80,6 @@ async def test_commit_and_reveal_weights_cr3(local_chain, subtensor, alice_walle
8180
alice_wallet,
8281
call_function="sudo_set_tempo",
8382
call_params={"netuid": netuid, "tempo": tempo_set},
84-
return_error_message=True,
8583
)[0]
8684
is True
8785
)

tests/e2e_tests/test_commit_weights.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ async def test_commit_and_reveal_weights_legacy(local_chain, subtensor, alice_wa
6060
alice_wallet,
6161
call_function="sudo_set_weights_set_rate_limit",
6262
call_params={"netuid": netuid, "weights_set_rate_limit": "0"},
63-
return_error_message=True,
6463
)
6564

6665
assert error is None
@@ -80,7 +79,6 @@ async def test_commit_and_reveal_weights_legacy(local_chain, subtensor, alice_wa
8079
"netuid": netuid,
8180
"tempo": 100,
8281
},
83-
return_error_message=True,
8482
)
8583

8684
# Commit-reveal values
@@ -202,7 +200,6 @@ async def test_commit_weights_uses_next_nonce(local_chain, subtensor, alice_wall
202200
alice_wallet,
203201
call_function="sudo_set_weights_set_rate_limit",
204202
call_params={"netuid": netuid, "weights_set_rate_limit": "0"},
205-
return_error_message=True,
206203
)
207204

208205
assert error is None

tests/e2e_tests/test_delegate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ def test_nominator_min_required_stake(local_chain, subtensor, alice_wallet, bob_
320320
call_params={
321321
"min_stake": "100000000000000",
322322
},
323-
return_error_message=True,
324323
)
325324

326325
minimum_required_stake = subtensor.get_minimum_required_stake()

tests/e2e_tests/test_dendrite.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ async def test_dendrite(local_chain, subtensor, templates, alice_wallet, bob_wal
4343
"netuid": netuid,
4444
"max_allowed_validators": 1,
4545
},
46-
return_error_message=True,
4746
)
4847

4948
# update weights_set_rate_limit for fast-blocks
@@ -55,7 +54,6 @@ async def test_dendrite(local_chain, subtensor, templates, alice_wallet, bob_wal
5554
"netuid": netuid,
5655
"weights_set_rate_limit": 10,
5756
},
58-
return_error_message=True,
5957
)
6058

6159
assert error is None

tests/e2e_tests/test_incentive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
7171
alice_wallet,
7272
call_function="sudo_set_weights_set_rate_limit",
7373
call_params={"netuid": netuid, "weights_set_rate_limit": 10},
74-
return_error_message=True,
7574
)
7675

7776
assert error is None

tests/e2e_tests/test_set_weights.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ async def test_set_weights_uses_next_nonce(local_chain, subtensor, alice_wallet)
3434
alice_wallet,
3535
call_function="sudo_set_network_rate_limit",
3636
call_params={"rate_limit": "0"}, # No limit
37-
return_error_message=True,
3837
)
3938
# Set lock reduction interval
4039
sudo_set_admin_utils(
4140
local_chain,
4241
alice_wallet,
4342
call_function="sudo_set_lock_reduction_interval",
4443
call_params={"interval": "1"}, # 1 block # reduce lock every block
45-
return_error_message=True,
4644
)
4745

4846
# Try to register the subnets
@@ -90,7 +88,6 @@ async def test_set_weights_uses_next_nonce(local_chain, subtensor, alice_wallet)
9088
alice_wallet,
9189
call_function="sudo_set_weights_set_rate_limit",
9290
call_params={"netuid": netuid, "weights_set_rate_limit": "0"},
93-
return_error_message=True,
9491
)
9592

9693
assert error is None

tests/e2e_tests/utils/chain_interactions.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ def sudo_set_admin_utils(
150150
wallet: "Wallet",
151151
call_function: str,
152152
call_params: dict,
153-
return_error_message: bool = False,
154-
) -> tuple[bool, str]:
153+
) -> tuple[bool, dict]:
155154
"""
156155
Wraps the call in sudo to set hyperparameter values using AdminUtils.
157156
@@ -160,10 +159,9 @@ def sudo_set_admin_utils(
160159
wallet (Wallet): Wallet object with the keypair for signing.
161160
call_function (str): The AdminUtils function to call.
162161
call_params (dict): Parameters for the AdminUtils function.
163-
return_error_message (bool): If True, returns the error message along with the success status.
164162
165163
Returns:
166-
Union[bool, tuple[bool, Optional[str]]]: Success status or (success status, error message).
164+
tuple[bool, dict]: (success status, error details).
167165
"""
168166
inner_call = substrate.compose_call(
169167
call_module="AdminUtils",
@@ -185,10 +183,7 @@ def sudo_set_admin_utils(
185183
wait_for_finalization=True,
186184
)
187185

188-
if return_error_message:
189-
return response.is_success, response.error_message
190-
191-
return response.is_success, ""
186+
return response.is_success, response.error_message
192187

193188

194189
async def root_set_subtensor_hyperparameter_values(

0 commit comments

Comments
 (0)