Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit #1111

Merged
merged 6 commits into from
Mar 8, 2023
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
4 changes: 2 additions & 2 deletions bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def turn_console_off():

__local_entrypoint__ = "ws://127.0.0.1:9945"

__tao_symbol__: str = u'\u03C4'.encode('utf-8')
__tao_symbol__: str = chr(0x03C4)

__rao_symbol__: str = u"\u03C1".encode('utf-8')
__rao_symbol__: str = chr(0x03C1)

# Block Explorers map network to explorer url
## Must all be polkadotjs explorer urls
Expand Down
2 changes: 2 additions & 0 deletions bittensor/_cli/commands/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def add_args( parser: argparse.ArgumentParser ):
)
delegate_stake_parser.add_argument(
'--delegate_ss58key',
'--delegate_ss58',
dest = "delegate_ss58key",
type = str,
required = False,
Expand Down Expand Up @@ -164,6 +165,7 @@ def add_args( parser: argparse.ArgumentParser ):
)
undelegate_stake_parser.add_argument(
'--delegate_ss58key',
'--delegate_ss58',
dest = "delegate_ss58key",
type = str,
required = False,
Expand Down
9 changes: 4 additions & 5 deletions tests/integration_tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def mock_get_wallet(*args, **kwargs):
else:
return mock_wallets[0]
# TODO: Fix mocking here
with patch('bittensor.cli_utils.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
with patch('bittensor._cli.commands.unstake.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
mock_get_all_wallets.side_effect = mock_get_wallet

# Check stakes before unstaking
Expand Down Expand Up @@ -443,7 +443,7 @@ def mock_get_wallet(*args, **kwargs):
else:
return mock_wallets[0]

with patch('bittensor.cli_utils.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
with patch('bittensor._cli.commands.unstake.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
mock_get_all_wallets.side_effect = mock_get_wallet

# Check stakes before unstaking
Expand Down Expand Up @@ -519,7 +519,7 @@ def mock_get_wallet(*args, **kwargs):
else:
return mock_wallets[0]

with patch('bittensor.cli_utils.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
with patch('bittensor._cli.commands.unstake.get_hotkey_wallets_for_wallet') as mock_get_all_wallets:
mock_get_all_wallets.side_effect = mock_get_wallet

# Check stakes before unstaking
Expand Down Expand Up @@ -671,7 +671,7 @@ def mock_get_wallet(*args, **kwargs):

with patch('bittensor.wallet') as mock_create_wallet:
mock_create_wallet.side_effect = mock_get_wallet
with patch('bittensor.cli_utils.get_hotkey_wallets_for_wallet') as mock_get_hotkey_wallets_for_wallet:
with patch('bittensor._cli.commands.stake.get_hotkey_wallets_for_wallet') as mock_get_hotkey_wallets_for_wallet:
mock_get_hotkey_wallets_for_wallet.return_value = mock_wallets

# Check stakes before staking
Expand Down Expand Up @@ -1171,7 +1171,6 @@ def mock_get_wallet(*args, **kwargs):
)
self.assertGreaterEqual(balance.tao, mock_balance.tao - config.max_stake)


def test_stake_with_single_hotkey_max_stake_enough_stake( self ):
# tests max stake when stake >= max_stake already
config = self.config
Expand Down
Binary file added tests/mock_subtensor/bin/Linux/node-subtensor
Binary file not shown.