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
6 changes: 5 additions & 1 deletion bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,11 @@ def root_my_delegates(
"""
self.verbosity_handler(quiet, verbose)
wallet = self.wallet_ask(
wallet_name, wallet_path, wallet_hotkey, ask_for=[WO.NAME]
wallet_name,
wallet_path,
wallet_hotkey,
ask_for=([WO.NAME] if not all_wallets else [WO.PATH]),
validate=WV.WALLET if not all_wallets else WV.NONE
)
self._run_command(
root.my_delegates(
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def read_requirements(path):
long_description_content_type="text/markdown",
url="https://github.com/opentensor/btcli",
author="bittensor.com",
packages=find_packages(exclude=["tests", "tests.*", "*/tests/*", "*/tests"]) + ['bittensor_cli.src.bittensor.templates'],
packages=find_packages(exclude=["tests", "tests.*", "*/tests/*", "*/tests"])
+ ["bittensor_cli.src.bittensor.templates"],
include_package_data=True,
package_data={
"": ["templates/*"],
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e_tests/test_senate.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_senate(local_chain, wallet_setup):

# Assert Bob is now part of the senate
assert wallet_bob.hotkey.ss58_address in root_senate_after_reg.stdout

# Manually add a proposal on the chain & assert
success = asyncio.run(call_add_proposal(local_chain, wallet_bob))
assert success is True
Expand Down Expand Up @@ -154,10 +154,10 @@ def test_senate(local_chain, wallet_setup):
assert proposals_after_aye_output[5] == "Aye"

# Aye votes increased to 1
assert proposals_after_aye_output[2] == '1'
assert proposals_after_aye_output[2] == "1"

# Nay votes remain 0
assert proposals_after_aye_output[3] == '0'
assert proposals_after_aye_output[3] == "0"

# Register Alice to the root network (0)
# Registering to root automatically makes you a senator if eligible
Expand Down
12 changes: 9 additions & 3 deletions tests/e2e_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from bittensor_wallet import Wallet

if TYPE_CHECKING:
from bittensor_cli.src.bittensor.async_substrate_interface import AsyncSubstrateInterface
from bittensor_cli.src.bittensor.async_substrate_interface import (
AsyncSubstrateInterface,
)

template_path = os.getcwd() + "/neurons/"
templates_repo = "templates repository"
Expand Down Expand Up @@ -287,7 +289,9 @@ def uninstall_templates(install_dir):
shutil.rmtree(install_dir)


async def call_add_proposal(substrate: "AsyncSubstrateInterface", wallet: Wallet) -> bool:
async def call_add_proposal(
substrate: "AsyncSubstrateInterface", wallet: Wallet
) -> bool:
async with substrate:
proposal_call = await substrate.compose_call(
call_module="System",
Expand All @@ -304,7 +308,9 @@ async def call_add_proposal(substrate: "AsyncSubstrateInterface", wallet: Wallet
},
)

extrinsic = await substrate.create_signed_extrinsic(call=call, keypair=wallet.coldkey)
extrinsic = await substrate.create_signed_extrinsic(
call=call, keypair=wallet.coldkey
)
response = await substrate.submit_extrinsic(
extrinsic,
wait_for_inclusion=True,
Expand Down