def test_inspect(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) #subtensor.register(wallet=wallet) config = construct_config() config.wallet.name = "inspect_testwallet" config.subtensor.network = "local" config.no_prompt = True config.subtensor.chain_endpoint = "localhost:{}".format(port) config.n_words = 12 config.use_password = False # First create a new coldkey config.command = "new_coldkey" cli = bittensor.cli(config) cli.run() # Now create a new hotkey config.command = "new_hotkey" cli = bittensor.cli(config) cli.run() # Now inspect it config.command = "inspect" cli = bittensor.cli(config) cli.run() config.command = "list" cli = bittensor.cli(config) cli.run()
def test_register(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) config = construct_config() config.command = "register" config.subtensor.network = "local" config.subtensor.chain_endpoint = "localhost:{}".format(port) config.no_prompt = True cli = bittensor.cli(config) cli.run()
def test_weights(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) #subtensor.register(wallet=wallet) config = construct_config() config.wallet.name = "weights_testwallet" config.command = "weights" config.subtensor.network = "local" config.no_prompt = True config.subtensor.chain_endpoint = "localhost:{}".format(port) cli = bittensor.cli(config) cli.run()
def test_set_weights(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) #subtensor.register(wallet=wallet) config = construct_config() config.wallet.name = "set_weights_testwallet" config.subtensor.network = "local" config.no_prompt = True config.uids = [1, 2, 3, 4] config.weights = [0.25, 0.25, 0.25, 0.25] config.subtensor.chain_endpoint = "localhost:{}".format(port) config.n_words = 12 config.use_password = False # First create a new hotkey config.command = "new_hotkey" cli = bittensor.cli(config) cli.run() # Now set the weights config.command = "set_weights" cli = bittensor.cli(config) cli.run()
def test_stake(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) config = construct_config() config.command = "stake" #, "unstake", "transfer"] config.amount = 1 config.subtensor.network = "local" config.stake_all = False config.subtensor.chain_endpoint = "localhost:{}".format(port) config.model = "template_miner" config.no_prompt = True cli = bittensor.cli(config) cli.run()
def test_regen_hotkey(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) #subtensor.register(wallet=wallet) config = construct_config() config.wallet.name = "regen_hotkey_testwallet" config.command = "regen_hotkey" config.amount = 1 config.subtensor.network = "local" config.subtensor.chain_endpoint = "localhost:{}".format(port) config.model = "template_miner" config.mnemonic = "faculty decade seven jelly gospel axis next radio grain radio remain gentle" config.n_words = 12 config.use_password = False config.no_prompt = True cli = bittensor.cli(config) cli.run()
def test_new_hotkey(setup_chain): subtensor, port = setup_subtensor(setup_chain) subtensor.register = MagicMock(return_value=True) #subtensor.register(wallet=wallet) config = construct_config() config.wallet.name = "new_hotkey_testwallet" config.command = "new_hotkey" config.amount = 1 config.subtensor.network = "local" config.dest = "no_prompt" config.subtensor.chain_endpoint = "localhost:{}".format(port) config.model = "template_miner" config.n_words = 12 config.use_password = False config.no_prompt = True cli = bittensor.cli(config) cli.run()