File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ python-Levenshtein
21
21
scalecodec==1.2.11
22
22
substrate-interface~=1.7.9
23
23
uvicorn
24
- bittensor-wallet== 2.0.1
24
+ bittensor-wallet>= 2.0.2
Original file line number Diff line number Diff line change
1
+ import bittensor
2
+ import argparse
3
+
4
+
5
+ def test_py_config_parsed_successfully_rust_wallet ():
6
+ """Verify that python based config object is successfully parsed with rust-based wallet object."""
7
+ # Preps
8
+ parser = argparse .ArgumentParser ()
9
+
10
+ bittensor .wallet .add_args (parser )
11
+ bittensor .subtensor .add_args (parser )
12
+ bittensor .axon .add_args (parser )
13
+ bittensor .logging .add_args (parser )
14
+
15
+ config = bittensor .config (parser )
16
+
17
+ # since we can't apply mocking to rust implewmented object then replace those directly
18
+ config .wallet .name = "new_wallet_name"
19
+ config .wallet .hotkey = "new_hotkey"
20
+ config .wallet .path = "/some/not_default/path"
21
+
22
+ wallet = bittensor .wallet (config = config )
23
+
24
+ # Asserts
25
+ assert wallet .name == config .wallet .name
26
+ assert wallet .hotkey_str == config .wallet .hotkey
27
+ assert wallet .path == config .wallet .path
You can’t perform that action at this time.
0 commit comments