-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from opentensor/fix/roman/make-ketpair-class-s…
…ubstrateinterface-keypair-compatable Add base and mro updating logic before add Wallet Keypair class to the main_module
- Loading branch information
Showing
6 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from substrateinterface import Keypair | ||
import pytest | ||
from bittensor_wallet import Wallet | ||
import time | ||
|
||
|
||
@pytest.fixture | ||
def mock_wallet(): | ||
wallet = Wallet( | ||
name=f"mock-{str(time.time())}", | ||
hotkey=f"mock-{str(time.time())}", | ||
path="/tmp/tests_wallets/do_not_use", | ||
) | ||
wallet.create_new_coldkey(use_password=False, overwrite=True, suppress=True) | ||
wallet.create_new_hotkey(use_password=False, overwrite=True, suppress=True) | ||
|
||
return wallet | ||
|
||
|
||
def test_keypair_type(mock_wallet): | ||
"""Makes sure that the wallet fields coldkey, hotkey, coldkeypub are compatible with substrateinterface.Keypair.""" | ||
# Preps | ||
wallet = mock_wallet | ||
|
||
# Assertions | ||
|
||
assert isinstance(wallet.coldkey, Keypair) | ||
assert isinstance(wallet.hotkey, Keypair) | ||
assert isinstance(wallet.coldkeypub, Keypair) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters