From ef7ca3b6fa3b1b30150772f5161c1fee93deb361 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 5 Aug 2024 17:16:37 -0700 Subject: [PATCH] Add `unlock_hotkeypub` method to the wallet. Add unit tests. --- bittensor_wallet/wallet.py | 9 +++++++++ tests/test_wallet.py | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/bittensor_wallet/wallet.py b/bittensor_wallet/wallet.py index d681dbc..71031df 100644 --- a/bittensor_wallet/wallet.py +++ b/bittensor_wallet/wallet.py @@ -537,6 +537,15 @@ def unlock_coldkey(self) -> Keypair: """ return self.coldkey + def unlock_coldkeypub(self) -> Keypair: + """ + Unlocks the coldkeypub. + + Returns: + coldkeypub (Keypair): the unlocked coldkeypub Keypair. + """ + return self.coldkeypub + def unlock_hotkey(self) -> Keypair: """ Unlocks the hotkey. diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 7210fcf..3dd0fd8 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -522,3 +522,13 @@ def test_unlock_coldkey(mock_wallet): # Assertions assert result == mock_wallet.coldkey + + +def test_unlock_coldkeypub(mock_wallet): + """Verify that `unlock_coldkeypub` works correctly.""" + + # Call + result = mock_wallet.unlock_coldkeypub() + + # Assertions + assert result == mock_wallet.coldkeypub