Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bittensor_cli/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Constants:
"test": "0x8f9cf856bf558a14440e75569c9e58594757048d7b3a84b5d25f6bd978263105",
}
delegates_detail_url = "https://raw.githubusercontent.com/opentensor/bittensor-delegates/main/public/delegates.json"
emission_start_schedule = 7 * 24 * 60 * 60 / 12 # 7 days
emission_start_schedule = 7 * 24 * 60 * 60 / 12 # 7 days


@dataclass
Expand Down
38 changes: 19 additions & 19 deletions bittensor_cli/src/bittensor/subtensor_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,25 +238,25 @@ async def get_stake_for_coldkey_and_hotkey(

:return: Balance: The stake under the coldkey - hotkey pairing.
"""
alpha_shares = await self.query(
module="SubtensorModule",
storage_function="Alpha",
params=[hotkey_ss58, coldkey_ss58, netuid],
block_hash=block_hash,
)

hotkey_alpha = await self.query(
module="SubtensorModule",
storage_function="TotalHotkeyAlpha",
params=[hotkey_ss58, netuid],
block_hash=block_hash,
)

hotkey_shares = await self.query(
module="SubtensorModule",
storage_function="TotalHotkeyShares",
params=[hotkey_ss58, netuid],
block_hash=block_hash,
alpha_shares, hotkey_alpha, hotkey_shares = await asyncio.gather(
self.query(
module="SubtensorModule",
storage_function="Alpha",
params=[hotkey_ss58, coldkey_ss58, netuid],
block_hash=block_hash,
),
self.query(
module="SubtensorModule",
storage_function="TotalHotkeyAlpha",
params=[hotkey_ss58, netuid],
block_hash=block_hash,
),
self.query(
module="SubtensorModule",
storage_function="TotalHotkeyShares",
params=[hotkey_ss58, netuid],
block_hash=block_hash,
),
)

alpha_shares_as_float = fixed_to_float(alpha_shares or 0)
Expand Down
4 changes: 3 additions & 1 deletion bittensor_cli/src/commands/subnets/subnets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,9 @@ async def start_subnet(
else:
error_msg = format_error_message(await response.error_message)
if "FirstEmissionBlockNumberAlreadySet" in error_msg:
console.print(f"[dark_sea_green3]Subnet {netuid} already has an emission schedule.[/dark_sea_green3]")
console.print(
f"[dark_sea_green3]Subnet {netuid} already has an emission schedule.[/dark_sea_green3]"
)
return True

await get_start_schedule(subtensor, netuid)
Expand Down
23 changes: 15 additions & 8 deletions tests/e2e_tests/test_unstaking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from btcli.tests.e2e_tests.utils import set_storage_extrinsic


def test_unstaking(local_chain, wallet_setup):
"""
Test various unstaking scenarios including partial unstake, unstake all alpha, and unstake all.
Expand Down Expand Up @@ -38,16 +39,22 @@ def test_unstaking(local_chain, wallet_setup):

# Call to make Alice root owner
items = [
(
bytes.fromhex("658faa385070e074c85bf6b568cf055536e3e82152c8758267395fe524fbbd160000"),
bytes.fromhex("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d")
(
bytes.fromhex(
"658faa385070e074c85bf6b568cf055536e3e82152c8758267395fe524fbbd160000"
),
bytes.fromhex(
"d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
),
)
]
asyncio.run(set_storage_extrinsic(
local_chain,
wallet=wallet_alice,
items=items,
))
asyncio.run(
set_storage_extrinsic(
local_chain,
wallet=wallet_alice,
items=items,
)
)

# Create first subnet (netuid = 2)
result = exec_command_alice(
Expand Down
Loading