Skip to content

Commit d417363

Browse files
authored
Merge pull request #690 from opentensor/release/9.14.3
Release/9.14.3
2 parents 85ab0ee + 7075c00 commit d417363

File tree

10 files changed

+205
-40
lines changed

10 files changed

+205
-40
lines changed

.github/workflows/e2e-subtensor-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
os:
7474
- ubuntu-latest
7575
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
76-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
76+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
7777
steps:
7878
- name: Check-out repository
7979
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Changelog
2+
## 9.14.3 /2025-10-30
3+
* Allows for installing on Py 3.14 by @thewhaleking in https://github.com/opentensor/btcli/pull/688
4+
* corrects `--name` param in `wallet set-identity` and `subnets set-identity` which was a duplicate param alias of `--wallet-name`
5+
6+
**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.14.2...v9.14.3
7+
28
## 9.14.2 /2025-10-28
39
* `stake remove --all` fails when unsuccessful by @thewhaleking in https://github.com/opentensor/btcli/pull/679
410
* check subnet logo url by @thewhaleking in https://github.com/opentensor/btcli/pull/681

bittensor_cli/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,7 +3326,7 @@ def wallet_set_id(
33263326
network: Optional[list[str]] = Options.network,
33273327
name: str = typer.Option(
33283328
"",
3329-
"--name",
3329+
"--id-name",
33303330
help="The display name for the identity.",
33313331
),
33323332
web_url: str = typer.Option(
@@ -6427,7 +6427,7 @@ def subnets_set_identity(
64276427
network: Optional[list[str]] = Options.network,
64286428
netuid: int = Options.netuid,
64296429
subnet_name: Optional[str] = typer.Option(
6430-
None, "--subnet-name", "--name", help="Name of the subnet"
6430+
None, "--subnet-name", "--sn-name", help="Name of the subnet"
64316431
),
64326432
github_repo: Optional[str] = typer.Option(
64336433
None, "--github-repo", "--repo", help="GitHub repository URL"

bittensor_cli/src/commands/liquidity/liquidity.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ async def get_liquidity_list(
342342
block_hash=block_hash,
343343
),
344344
)
345+
if len(positions_response.records) == 0:
346+
return False, "No liquidity positions found.", []
345347

346348
current_sqrt_price = fixed_to_float(current_sqrt_price)
347349
fee_global_tao = fixed_to_float(fee_global_tao)
@@ -459,9 +461,21 @@ async def show_liquidity_list(
459461
netuid: int,
460462
json_output: bool = False,
461463
) -> None:
462-
current_price_, (success, err_msg, positions) = await asyncio.gather(
463-
subtensor.subnet(netuid=netuid), get_liquidity_list(subtensor, wallet, netuid)
464+
current_price_, liquidity_list_ = await asyncio.gather(
465+
subtensor.subnet(netuid=netuid),
466+
get_liquidity_list(subtensor, wallet, netuid),
467+
return_exceptions=True,
464468
)
469+
if isinstance(current_price_, Exception):
470+
success = False
471+
err_msg = str(current_price_)
472+
positions = []
473+
elif isinstance(liquidity_list_, Exception):
474+
success = False
475+
err_msg = str(liquidity_list_)
476+
positions = []
477+
else:
478+
(success, err_msg, positions) = liquidity_list_
465479
if not success:
466480
if json_output:
467481
json_console.print(

bittensor_cli/src/commands/stake/add.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ async def stake_extrinsic(
481481
success, er_msg, ext_receipt = await coroutine
482482
successes[ni][staking_address] = success
483483
error_messages[ni][staking_address] = er_msg
484-
extrinsic_ids[ni][
485-
staking_address
486-
] = await ext_receipt.get_extrinsic_identifier()
484+
if success:
485+
extrinsic_ids[ni][
486+
staking_address
487+
] = await ext_receipt.get_extrinsic_identifier()
487488
if json_output:
488489
json_console.print_json(
489490
data={

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bittensor-cli"
7-
version = "9.14.2"
7+
version = "9.14.3"
88
description = "Bittensor CLI"
99
readme = "README.md"
1010
authors = [
1111
{name = "bittensor.com"}
1212
]
1313
license = { file = "LICENSE" }
1414
scripts = { btcli = "bittensor_cli.cli:main" }
15-
requires-python = ">=3.9,<3.14"
15+
requires-python = ">=3.9,<3.15"
1616
dependencies = [
1717
"wheel",
1818
"async-substrate-interface>=1.5.2",

tests/e2e_tests/test_liquidity.py

Lines changed: 121 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import json
33
import re
4+
import time
45

56
from bittensor_cli.src.bittensor.balances import Balance
67
from .utils import turn_off_hyperparam_freeze_window
@@ -16,25 +17,6 @@
1617

1718

1819
def test_liquidity(local_chain, wallet_setup):
19-
def liquidity_list():
20-
return exec_command_alice(
21-
command="liquidity",
22-
sub_command="list",
23-
extra_args=[
24-
"--wallet-path",
25-
wallet_path_alice,
26-
"--chain",
27-
"ws://127.0.0.1:9945",
28-
"--wallet-name",
29-
wallet_alice.name,
30-
"--wallet-hotkey",
31-
wallet_alice.hotkey_str,
32-
"--netuid",
33-
netuid,
34-
"--json-output",
35-
],
36-
)
37-
3820
wallet_path_alice = "//Alice"
3921
netuid = 2
4022

@@ -48,6 +30,7 @@ def liquidity_list():
4830
print(
4931
"Skipping turning off hyperparams freeze window. This indicates the call does not exist on the chain you are testing."
5032
)
33+
time.sleep(10)
5134

5235
# Register a subnet with sudo as Alice
5336
result = exec_command_alice(
@@ -88,7 +71,23 @@ def liquidity_list():
8871
assert isinstance(result_output["extrinsic_identifier"], str)
8972

9073
# verify no results for list thus far (subnet not yet started)
91-
liquidity_list_result = liquidity_list()
74+
liquidity_list_result = exec_command_alice(
75+
command="liquidity",
76+
sub_command="list",
77+
extra_args=[
78+
"--wallet-path",
79+
wallet_path_alice,
80+
"--chain",
81+
"ws://127.0.0.1:9945",
82+
"--wallet-name",
83+
wallet_alice.name,
84+
"--wallet-hotkey",
85+
wallet_alice.hotkey_str,
86+
"--netuid",
87+
netuid,
88+
"--json-output",
89+
],
90+
)
9291
result_output = json.loads(liquidity_list_result.stdout)
9392
assert result_output["success"] is False
9493
assert f"Subnet with netuid: {netuid} is not active" in result_output["err_msg"]
@@ -118,10 +117,51 @@ def liquidity_list():
118117
), start_subnet_emissions.stderr
119118
assert "Your extrinsic has been included " in start_subnet_emissions.stdout
120119

121-
liquidity_list_result = liquidity_list()
120+
stake_to_enable_v3 = exec_command_alice(
121+
command="stake",
122+
sub_command="add",
123+
extra_args=[
124+
"--netuid",
125+
"2",
126+
"--wallet-path",
127+
wallet_path_alice,
128+
"--wallet-name",
129+
wallet_alice.name,
130+
"--hotkey",
131+
wallet_alice.hotkey_str,
132+
"--chain",
133+
"ws://127.0.0.1:9945",
134+
"--amount",
135+
"1",
136+
"--unsafe",
137+
"--no-prompt",
138+
"--era",
139+
"144",
140+
],
141+
)
142+
assert "✅ Finalized" in stake_to_enable_v3.stdout, stake_to_enable_v3.stderr
143+
time.sleep(10)
144+
liquidity_list_result = exec_command_alice(
145+
command="liquidity",
146+
sub_command="list",
147+
extra_args=[
148+
"--wallet-path",
149+
wallet_path_alice,
150+
"--chain",
151+
"ws://127.0.0.1:9945",
152+
"--wallet-name",
153+
wallet_alice.name,
154+
"--wallet-hotkey",
155+
wallet_alice.hotkey_str,
156+
"--netuid",
157+
netuid,
158+
"--json-output",
159+
],
160+
)
161+
print(">>>", liquidity_list_result.stdout, liquidity_list_result.stderr)
122162
result_output = json.loads(liquidity_list_result.stdout)
123-
assert result_output["success"] is True
124-
assert result_output["err_msg"] == ""
163+
assert result_output["success"] is False
164+
assert result_output["err_msg"] == "No liquidity positions found."
125165
assert result_output["positions"] == []
126166

127167
enable_user_liquidity = exec_command_alice(
@@ -179,13 +219,29 @@ def liquidity_list():
179219
assert add_liquidity_result["message"] == ""
180220
assert isinstance(add_liquidity_result["extrinsic_identifier"], str)
181221

182-
liquidity_list_result = liquidity_list()
222+
liquidity_list_result = exec_command_alice(
223+
command="liquidity",
224+
sub_command="list",
225+
extra_args=[
226+
"--wallet-path",
227+
wallet_path_alice,
228+
"--chain",
229+
"ws://127.0.0.1:9945",
230+
"--wallet-name",
231+
wallet_alice.name,
232+
"--wallet-hotkey",
233+
wallet_alice.hotkey_str,
234+
"--netuid",
235+
netuid,
236+
"--json-output",
237+
],
238+
)
239+
print(">>>", liquidity_list_result.stdout, liquidity_list_result.stderr)
183240
liquidity_list_result = json.loads(liquidity_list_result.stdout)
184241
assert liquidity_list_result["success"] is True
185242
assert len(liquidity_list_result["positions"]) == 1
186243
liquidity_position = liquidity_list_result["positions"][0]
187244
assert liquidity_position["liquidity"] == 1.0
188-
assert liquidity_position["id"] == 2
189245
assert liquidity_position["fees_tao"] == 0.0
190246
assert liquidity_position["fees_alpha"] == 0.0
191247
assert liquidity_position["netuid"] == netuid
@@ -218,10 +274,27 @@ def liquidity_list():
218274
assert modify_liquidity_result["success"] is True
219275
assert isinstance(modify_liquidity_result["extrinsic_identifier"], str)
220276

221-
liquidity_list_result = json.loads(liquidity_list().stdout)
277+
llr = exec_command_alice(
278+
command="liquidity",
279+
sub_command="list",
280+
extra_args=[
281+
"--wallet-path",
282+
wallet_path_alice,
283+
"--chain",
284+
"ws://127.0.0.1:9945",
285+
"--wallet-name",
286+
wallet_alice.name,
287+
"--wallet-hotkey",
288+
wallet_alice.hotkey_str,
289+
"--netuid",
290+
netuid,
291+
"--json-output",
292+
],
293+
)
294+
print(">>>", llr.stdout, llr.stderr)
295+
liquidity_list_result = json.loads(llr.stdout)
222296
assert len(liquidity_list_result["positions"]) == 1
223297
liquidity_position = liquidity_list_result["positions"][0]
224-
assert liquidity_position["id"] == 2
225298
assert liquidity_position["liquidity"] == 21.0
226299

227300
removal = exec_command_alice(
@@ -249,6 +322,25 @@ def liquidity_list():
249322
removal_result[str(liquidity_position["id"])]["extrinsic_identifier"], str
250323
)
251324

252-
liquidity_list_result = json.loads(liquidity_list().stdout)
253-
assert liquidity_list_result["success"] is True
325+
liquidity_list_result = exec_command_alice(
326+
command="liquidity",
327+
sub_command="list",
328+
extra_args=[
329+
"--wallet-path",
330+
wallet_path_alice,
331+
"--chain",
332+
"ws://127.0.0.1:9945",
333+
"--wallet-name",
334+
wallet_alice.name,
335+
"--wallet-hotkey",
336+
wallet_alice.hotkey_str,
337+
"--netuid",
338+
netuid,
339+
"--json-output",
340+
],
341+
)
342+
print(">>>", liquidity_list_result.stdout, liquidity_list_result.stderr)
343+
liquidity_list_result = json.loads(liquidity_list_result.stdout)
344+
assert liquidity_list_result["success"] is False
345+
assert result_output["err_msg"] == "No liquidity positions found."
254346
assert liquidity_list_result["positions"] == []

tests/e2e_tests/test_staking_sudo.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,32 @@ def test_staking(local_chain, wallet_setup):
325325
start_subnet_emissions.stdout
326326
)
327327

328+
# Add initial stake to enable V3
329+
for netuid_ in multiple_netuids:
330+
stake_to_enable_v3 = exec_command_alice(
331+
command="stake",
332+
sub_command="add",
333+
extra_args=[
334+
"--netuid",
335+
netuid_,
336+
"--wallet-path",
337+
wallet_path_alice,
338+
"--wallet-name",
339+
wallet_alice.name,
340+
"--hotkey",
341+
wallet_alice.hotkey_str,
342+
"--chain",
343+
"ws://127.0.0.1:9945",
344+
"--amount",
345+
"1",
346+
"--unsafe",
347+
"--no-prompt",
348+
"--era",
349+
"144",
350+
],
351+
)
352+
assert "✅ Finalized" in stake_to_enable_v3.stdout, stake_to_enable_v3.stderr
353+
328354
# Add stake to Alice's hotkey
329355
add_stake_single = exec_command_alice(
330356
command="stake",

tests/e2e_tests/test_unstaking.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,32 @@ def test_unstaking(local_chain, wallet_setup):
215215
register_result.stdout
216216
)
217217

218+
# Add initial stake to enable V3
219+
for netuid_ in [0, 2, 3]:
220+
stake_to_enable_v3 = exec_command_bob(
221+
command="stake",
222+
sub_command="add",
223+
extra_args=[
224+
"--netuid",
225+
netuid_,
226+
"--wallet-path",
227+
wallet_path_bob,
228+
"--wallet-name",
229+
wallet_bob.name,
230+
"--hotkey",
231+
wallet_bob.hotkey_str,
232+
"--chain",
233+
"ws://127.0.0.1:9945",
234+
"--amount",
235+
"1",
236+
"--unsafe",
237+
"--no-prompt",
238+
"--era",
239+
"144",
240+
],
241+
)
242+
assert "✅ Finalized" in stake_to_enable_v3.stdout, stake_to_enable_v3.stderr
243+
218244
# Add stake to subnets
219245
for netuid in [0, 2, 3]:
220246
stake_result = exec_command_bob(

tests/e2e_tests/test_wallet_interactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_wallet_identities(local_chain, wallet_setup):
421421
wallet_alice.name,
422422
"--wallet-hotkey",
423423
wallet_alice.hotkey_str,
424-
"--name",
424+
"--id-name",
425425
alice_identity["name"],
426426
"--web-url",
427427
alice_identity["url"],

0 commit comments

Comments
 (0)