From 63bf0768d35c86722535c8789f07e82b3cf5dee6 Mon Sep 17 00:00:00 2001 From: Olzhas Arystanov Date: Mon, 6 May 2024 23:18:28 +0500 Subject: [PATCH] Remove unused hotkey setting and env var --- app/src/bittensor_panel/core/bt.py | 1 - app/src/bittensor_panel/core/tests/test_bt.py | 9 ++------- app/src/bittensor_panel/core/tests/test_services.py | 4 +--- app/src/bittensor_panel/settings.py | 1 - envs/dev/.env.template | 1 - 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/src/bittensor_panel/core/bt.py b/app/src/bittensor_panel/core/bt.py index 31d28d8..ea8b028 100644 --- a/app/src/bittensor_panel/core/bt.py +++ b/app/src/bittensor_panel/core/bt.py @@ -19,7 +19,6 @@ def get_subtensor() -> bittensor.subtensor: def get_wallet() -> bittensor.wallet: return bittensor.wallet( name=settings.WALLET_NAME, - hotkey=settings.WALLET_HOTKEY, path=settings.WALLET_PATH, ) diff --git a/app/src/bittensor_panel/core/tests/test_bt.py b/app/src/bittensor_panel/core/tests/test_bt.py index 4353c7b..e35b75d 100644 --- a/app/src/bittensor_panel/core/tests/test_bt.py +++ b/app/src/bittensor_panel/core/tests/test_bt.py @@ -43,7 +43,6 @@ def test_get_wallet(mocker: MockerFixture, settings): mock.assert_called_once_with( name=settings.WALLET_NAME, - hotkey=settings.WALLET_HOTKEY, path=settings.WALLET_PATH, ) @@ -115,9 +114,7 @@ def mock_wallet(mocker: MockerFixture): @pytest.mark.parametrize("result", [True, False]) -def test_update_remote_hyperparam( - mock_subtensor: MagicMock, mock_wallet: MagicMock, result: bool, settings -): +def test_update_remote_hyperparam(mock_subtensor: MagicMock, mock_wallet: MagicMock, result: bool, settings): mock_subtensor.return_value.set_hyperparameter.return_value = result name = "difficulty" @@ -136,9 +133,7 @@ def test_update_remote_hyperparam( ) -def test_update_remote_hyperparam_exception( - mock_subtensor: MagicMock, mock_wallet: MagicMock -): +def test_update_remote_hyperparam_exception(mock_subtensor: MagicMock, mock_wallet: MagicMock): mock_subtensor.return_value.set_hyperparameter.side_effect = RuntimeError with pytest.raises(SubtensorServerError): diff --git a/app/src/bittensor_panel/core/tests/test_services.py b/app/src/bittensor_panel/core/tests/test_services.py index cefcfd8..fb4513c 100644 --- a/app/src/bittensor_panel/core/tests/test_services.py +++ b/app/src/bittensor_panel/core/tests/test_services.py @@ -82,9 +82,7 @@ def hyperparam_dict(faker: Faker): @pytest.fixture def mock_load_hyperparams(mocker: MockerFixture, hyperparam_dict: dict[str, int]): - return mocker.patch( - "bittensor_panel.core.services.load_hyperparams", return_value=hyperparam_dict - ) + return mocker.patch("bittensor_panel.core.services.load_hyperparams", return_value=hyperparam_dict) def test_refresh_hyperparams( diff --git a/app/src/bittensor_panel/settings.py b/app/src/bittensor_panel/settings.py index dde631d..9542bb4 100644 --- a/app/src/bittensor_panel/settings.py +++ b/app/src/bittensor_panel/settings.py @@ -313,5 +313,4 @@ def configure_structlog(): SUBTENSOR_ADDRESS = env.str("SUBTENSOR_ADDRESS", default="local") SUBNET_UID = env.int("SUBNET_UID") WALLET_NAME = env.str("WALLET_NAME") -WALLET_HOTKEY = env.str("WALLET_HOTKEY") WALLET_PATH = env.path("WALLET_PATH") diff --git a/envs/dev/.env.template b/envs/dev/.env.template index 22132b4..8b5aa71 100644 --- a/envs/dev/.env.template +++ b/envs/dev/.env.template @@ -69,5 +69,4 @@ BACKUP_LOCAL_ROTATE_KEEP_LAST= SUBTENSOR_ADDRESS=local SUBNET_UID=1 WALLET_NAME="default" -WALLET_HOTKEY="default" WALLET_PATH=""