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

Extract wallet #1403

Merged
merged 41 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0aa2029
integrate openconfig progess
camfairchild Jun 21, 2023
e038d2a
add type or suppress for argparse
camfairchild Jun 22, 2023
0f8700f
use for problematic types
camfairchild Jun 22, 2023
b9cf48b
fix type hints
camfairchild Jun 22, 2023
f29f177
move test under testcase class
camfairchild Jun 22, 2023
6d75d3b
move tests under testcase class
camfairchild Jun 22, 2023
a1f0f64
add test for btcli with empty arguments on every command
camfairchild Jun 22, 2023
8a221de
remove unneeded setup from test
camfairchild Jun 22, 2023
af0bc34
remove type or suppress from int
camfairchild Jun 22, 2023
fedeabe
remove to defaults test
camfairchild Jun 22, 2023
9bd4a82
use dot get for prefix check
camfairchild Jun 22, 2023
98836b4
move test to package
camfairchild Jun 22, 2023
50fec0d
move wallet mock
camfairchild Jun 22, 2023
918cf4a
move some utils to package
camfairchild Jun 22, 2023
6378eb2
move wallet to package
camfairchild Jun 22, 2023
5a66d27
move reregister to registration utils
camfairchild Jun 22, 2023
c4daa9b
add mocks
camfairchild Jun 22, 2023
8c6cd1e
move keyfile to package
camfairchild Jun 22, 2023
1664def
move test to utils tests
camfairchild Jun 22, 2023
ac751bf
use different naming
camfairchild Jun 22, 2023
485e4d5
fix import
camfairchild Jun 22, 2023
001538c
change function name and use kwargs
camfairchild Jun 22, 2023
f466485
modify naming
camfairchild Jun 22, 2023
64bbb5d
add is_hotkey_registered
camfairchild Jun 22, 2023
aedd734
use new function
camfairchild Jun 22, 2023
450381c
fix patch
camfairchild Jun 22, 2023
b41080b
arg is cuda (typo)
camfairchild Jun 22, 2023
d75afc5
specify reregister true
camfairchild Jun 22, 2023
587e08d
use generate wallet
camfairchild Jun 22, 2023
2afb79c
get mock wallet during tests
camfairchild Jun 22, 2023
c7a5d8c
extract get ss58 format util
camfairchild Jun 22, 2023
0608f7d
remove _mock arg
camfairchild Jun 22, 2023
191f417
extract tests
camfairchild Jun 22, 2023
81063ec
import from base
camfairchild Jun 22, 2023
f2ecc0d
use subtensor for get_balance
camfairchild Jun 22, 2023
03d6420
use new hotkey during test
camfairchild Jun 22, 2023
e18f77e
fix mocking
camfairchild Jun 22, 2023
439538e
add new packages to reqs file
camfairchild Jun 26, 2023
9b1c23d
use new package naming
camfairchild Jun 26, 2023
d0f271b
Merge branch 'extract_wallet_and_config' into extract_wallet
camfairchild Jun 27, 2023
0b81613
bump wallet dep
camfairchild Jun 27, 2023
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
21 changes: 7 additions & 14 deletions bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def turn_console_off():
from bittensor._cli import cli as cli
from bittensor._axon import axon as axon
from bittensor._axon import axon_info as axon_info
from bittensor._wallet import wallet as wallet
from bittensor._keyfile import keyfile as keyfile
from bittensor_wallet import wallet as wallet
from bittensor_wallet import keyfile as keyfile
from bittensor._metagraph import metagraph as metagraph
from bittensor._prometheus import prometheus as prometheus
from bittensor._subtensor import subtensor as subtensor
Expand All @@ -171,8 +171,9 @@ def turn_console_off():
from bittensor._cli.cli_impl import CLI as CLI
from bittensor_config.config_impl import Config as Config
from bittensor._subtensor.chain_data import DelegateInfo as DelegateInfo
from bittensor._wallet.wallet_impl import Wallet as Wallet
from bittensor._keyfile.keyfile_impl import Keyfile as Keyfile
from bittensor_wallet import Wallet as Wallet
from bittensor_wallet import Keyfile as Keyfile
from bittensor_wallet import Keypair as Keypair
from bittensor._subtensor.chain_data import NeuronInfo as NeuronInfo
from bittensor._subtensor.chain_data import NeuronInfoLite as NeuronInfoLite
from bittensor._subtensor.chain_data import PrometheusInfo as PrometheusInfo
Expand All @@ -184,7 +185,7 @@ def turn_console_off():
from bittensor._ipfs.ipfs_impl import Ipfs as Ipfs

# ---- Errors and Exceptions -----
from bittensor._keyfile.keyfile_impl import KeyFileError as KeyFileError
from bittensor_wallet import KeyFileError as KeyFileError

from bittensor._proto.bittensor_pb2 import ForwardTextPromptingRequest
from bittensor._proto.bittensor_pb2 import ForwardTextPromptingResponse
Expand All @@ -210,25 +211,17 @@ def turn_console_off():
from bittensor._neuron.base_prompting_miner import BasePromptingMiner
from bittensor._neuron.base_huggingface_miner import HuggingFaceMiner

# ---- Errors and Exceptions -----
from bittensor._keyfile.keyfile_impl import KeyFileError as KeyFileError

# ---- Errors and Exceptions -----
from bittensor._keyfile.keyfile_impl import KeyFileError as KeyFileError

# DEFAULTS
defaults = Config()
defaults.netuid = 1
subtensor.add_defaults( defaults )
axon.add_defaults( defaults )
prioritythreadpool.add_defaults( defaults )
prometheus.add_defaults( defaults )
wallet.add_defaults( defaults )
wallet.add_defaults( defaults, prefix = 'wallet' )
dataset.add_defaults( defaults )
logging.add_defaults( defaults )

from substrateinterface import Keypair as Keypair

# Logging helpers.
def trace():
logging.set_trace(True)
Expand Down
2 changes: 1 addition & 1 deletion bittensor/_cli/commands/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run (cli):
for wallet in tqdm( wallets ):
delegates: List[Tuple(bittensor.DelegateInfo, bittensor.Balance)] = subtensor.get_delegated( coldkey_ss58=wallet.coldkeypub.ss58_address )
if not wallet.coldkeypub_file.exists_on_device(): continue
cold_balance = wallet.get_balance( subtensor = subtensor )
cold_balance = subtensor.get_balance( wallet.coldkeypub.ss58_address )
table.add_row(
wallet.name,
str(cold_balance),
Expand Down
Loading