Skip to content

Commit f39c77b

Browse files
authored
Merge pull request #2879 from opentensor/fix/roman/serve_axon
Using `hotkey` instead of `coldkey` to sign extrinsic in `serve_axon`
2 parents 529d204 + f6c175d commit f39c77b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

bittensor/core/extrinsics/asyncex/serving.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ async def do_serve_axon(
6161
wallet=wallet,
6262
wait_for_inclusion=wait_for_inclusion,
6363
wait_for_finalization=wait_for_finalization,
64+
sign_with="hotkey",
6465
period=period,
6566
)
6667
return success, message
@@ -140,7 +141,7 @@ async def serve_extrinsic(
140141
f"Serving axon with: [blue]AxonInfo({wallet.hotkey.ss58_address}, {ip}:{port})[/blue] -> "
141142
f"[green]{subtensor.network}:{netuid}[/green]"
142143
)
143-
success, message = do_serve_axon(
144+
success, message = await do_serve_axon(
144145
subtensor=subtensor,
145146
wallet=wallet,
146147
call_params=params,

bittensor/core/extrinsics/serving.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def do_serve_axon(
6060
wallet=wallet,
6161
wait_for_inclusion=wait_for_inclusion,
6262
wait_for_finalization=wait_for_finalization,
63+
sign_with="hotkey",
6364
period=period,
6465
)
6566
return success, message

tests/unit_tests/test_subtensor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,7 @@ def test_do_serve_axon_is_success(
14921492
wallet=fake_wallet,
14931493
wait_for_inclusion=fake_wait_for_inclusion,
14941494
wait_for_finalization=fake_wait_for_finalization,
1495+
sign_with="hotkey",
14951496
period=None,
14961497
)
14971498

@@ -1530,6 +1531,7 @@ def test_do_serve_axon_is_not_success(subtensor, fake_wallet, mocker, fake_call_
15301531
wallet=fake_wallet,
15311532
wait_for_inclusion=fake_wait_for_inclusion,
15321533
wait_for_finalization=fake_wait_for_finalization,
1534+
sign_with="hotkey",
15331535
period=None,
15341536
)
15351537

@@ -1568,6 +1570,7 @@ def test_do_serve_axon_no_waits(subtensor, fake_wallet, mocker, fake_call_params
15681570
wallet=fake_wallet,
15691571
wait_for_inclusion=fake_wait_for_inclusion,
15701572
wait_for_finalization=fake_wait_for_finalization,
1573+
sign_with="hotkey",
15711574
period=None,
15721575
)
15731576
assert result == (True, "")

0 commit comments

Comments
 (0)