Skip to content

Commit 4e09d45

Browse files
authored
Merge pull request #12 from opentensor/feat/roman/add-unlock-coldkeypub
Add `unlock_hotkeypub` method to the wallet. Add unit tests.
2 parents c1c6691 + ef7ca3b commit 4e09d45

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

bittensor_wallet/wallet.py

+9
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,15 @@ def unlock_coldkey(self) -> Keypair:
537537
"""
538538
return self.coldkey
539539

540+
def unlock_coldkeypub(self) -> Keypair:
541+
"""
542+
Unlocks the coldkeypub.
543+
544+
Returns:
545+
coldkeypub (Keypair): the unlocked coldkeypub Keypair.
546+
"""
547+
return self.coldkeypub
548+
540549
def unlock_hotkey(self) -> Keypair:
541550
"""
542551
Unlocks the hotkey.

tests/test_wallet.py

+10
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,13 @@ def test_unlock_coldkey(mock_wallet):
522522

523523
# Assertions
524524
assert result == mock_wallet.coldkey
525+
526+
527+
def test_unlock_coldkeypub(mock_wallet):
528+
"""Verify that `unlock_coldkeypub` works correctly."""
529+
530+
# Call
531+
result = mock_wallet.unlock_coldkeypub()
532+
533+
# Assertions
534+
assert result == mock_wallet.coldkeypub

0 commit comments

Comments
 (0)