Skip to content

Commit

Permalink
Add unlock_hotkeypub method to the wallet. Add unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-opentensor committed Aug 6, 2024
1 parent c1c6691 commit ef7ca3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bittensor_wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ef7ca3b

Please sign in to comment.