Skip to content

Commit 20f8c4a

Browse files
committed
Test Unstaking
1 parent cb9d160 commit 20f8c4a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/e2e_tests/test_unstaking.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import re
23

34
from bittensor_cli.src.bittensor.balances import Balance
@@ -217,6 +218,25 @@ def test_unstaking(local_chain, wallet_setup):
217218
float(inital_stake_netuid_2)
218219
)
219220

221+
show_stake_json = exec_command_alice(
222+
command="stake",
223+
sub_command="list",
224+
extra_args=[
225+
"--wallet-path",
226+
wallet_path_bob,
227+
"--wallet-name",
228+
wallet_bob.name,
229+
"--chain",
230+
"ws://127.0.0.1:9945",
231+
"--json-output",
232+
],
233+
)
234+
show_stake_json_output = json.loads(show_stake_json.stdout)
235+
bob_stake = show_stake_json_output["stake_info"][keypair_bob.ss58_address]
236+
assert Balance.from_tao(
237+
next(filter(lambda x: x["netuid"] == 2, bob_stake))["stake_value"]
238+
) <= Balance.from_tao(float(inital_stake_netuid_2))
239+
220240
# Remove all alpha stakes
221241
unstake_alpha = exec_command_bob(
222242
command="stake",

0 commit comments

Comments
 (0)