Skip to content

Commit 5231b5e

Browse files
committed
Updates tests
1 parent 946b3ca commit 5231b5e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/e2e_tests/test_staking_sudo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def test_staking(local_chain, wallet_setup):
298298

299299
# Parse all hyperparameters and single out max_burn in TAO
300300
all_hyperparams = hyperparams.stdout.splitlines()
301-
max_burn_tao = all_hyperparams[22].split()[3]
301+
max_burn_tao = all_hyperparams[22].split()[2].strip('\u200e')
302302

303303
# Assert max_burn is 100 TAO from default
304304
assert Balance.from_tao(float(max_burn_tao)) == Balance.from_tao(100.0)
@@ -359,7 +359,7 @@ def test_staking(local_chain, wallet_setup):
359359

360360
# Parse updated hyperparameters
361361
all_updated_hyperparams = updated_hyperparams.stdout.splitlines()
362-
updated_max_burn_tao = all_updated_hyperparams[22].split()[3]
362+
updated_max_burn_tao = all_updated_hyperparams[22].split()[2].strip('\u200e')
363363

364364
# Assert max_burn is now 10 TAO
365365
assert Balance.from_tao(float(updated_max_burn_tao)) == Balance.from_tao(10)

tests/e2e_tests/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def exec_command(
5757
return keypair, wallet, wallet_path, exec_command
5858

5959

60-
def extract_coldkey_balance(text: str, wallet_name: str, coldkey_address: str) -> dict:
60+
def extract_coldkey_balance(cleaned_text: str, wallet_name: str, coldkey_address: str) -> dict:
6161
"""
6262
Extracts the free, staked, and total balances for a
6363
given wallet name and coldkey address from the input string.
@@ -72,11 +72,12 @@ def extract_coldkey_balance(text: str, wallet_name: str, coldkey_address: str) -
7272
each containing the corresponding balance as a Balance object.
7373
Returns a dictionary with all zeros if the wallet name or coldkey address is not found.
7474
"""
75+
cleaned_text = cleaned_text.replace('\u200e', '')
7576
pattern = (
76-
rf"{wallet_name}\s+{coldkey_address}\s+" r"τ\s*([\d,]+\.\d+)" # Free Balance
77+
rf"{wallet_name}\s+{coldkey_address}\s+([\d,]+\.\d+)\s*τ" # Free Balance
7778
)
7879

79-
match = re.search(pattern, text)
80+
match = re.search(pattern, cleaned_text)
8081

8182
if not match:
8283
return {

0 commit comments

Comments
 (0)