1
- import logging
2
-
3
1
from bittensor_cli .src .bittensor .balances import Balance
4
-
5
2
from tests .e2e_tests .utils import (
6
3
extract_coldkey_balance ,
7
- setup_wallet ,
8
4
validate_wallet_inspect ,
9
5
validate_wallet_overview ,
10
6
verify_subnet_entry ,
11
- remove_wallets ,
12
7
)
13
8
14
9
"""
22
17
"""
23
18
24
19
25
- def test_wallet_overview_inspect (local_chain ):
20
+ def test_wallet_overview_inspect (local_chain , wallet_setup ):
26
21
"""
27
22
Test the overview and inspect commands of the wallet by interaction with subnets
28
23
@@ -40,7 +35,7 @@ def test_wallet_overview_inspect(local_chain):
40
35
wallet_path_name = "//Alice"
41
36
42
37
# Create wallet for Alice
43
- keypair , wallet , wallet_path , exec_command = setup_wallet (wallet_path_name )
38
+ keypair , wallet , wallet_path , exec_command = wallet_setup (wallet_path_name )
44
39
45
40
# Register a subnet with sudo as Alice
46
41
result = exec_command (
@@ -176,7 +171,6 @@ def test_wallet_overview_inspect(local_chain):
176
171
], # (netuid, hotkey-display, stake, check_emissions)
177
172
)
178
173
print ("Passed wallet overview, inspect command ✅" )
179
- remove_wallets (wallet_path )
180
174
181
175
182
176
"""
@@ -187,7 +181,7 @@ def test_wallet_overview_inspect(local_chain):
187
181
"""
188
182
189
183
190
- def test_wallet_transfer (local_chain ):
184
+ def test_wallet_transfer (local_chain , wallet_setup ):
191
185
"""
192
186
Test the transfer and balance functionality in the Bittensor network.
193
187
@@ -206,10 +200,10 @@ def test_wallet_transfer(local_chain):
206
200
wallet_path_bob = "//Bob"
207
201
208
202
# Create wallets for Alice and Bob
209
- keypair_alice , wallet_alice , wallet_path_alice , exec_command_alice = setup_wallet (
203
+ keypair_alice , wallet_alice , wallet_path_alice , exec_command_alice = wallet_setup (
210
204
wallet_path_alice
211
205
)
212
- keypair_bob , wallet_bob , wallet_path_bob , exec_command_bob = setup_wallet (
206
+ keypair_bob , wallet_bob , wallet_path_bob , exec_command_bob = wallet_setup (
213
207
wallet_path_bob
214
208
)
215
209
@@ -332,7 +326,7 @@ def test_wallet_transfer(local_chain):
332
326
333
327
wallet_path_anakin = "//Anakin"
334
328
keypair_anakin , wallet_anakin , wallet_path_anakin , exec_command_anakin = (
335
- setup_wallet (wallet_path_anakin )
329
+ wallet_setup (wallet_path_anakin )
336
330
)
337
331
338
332
# Attempt transferring to Alice
@@ -358,8 +352,4 @@ def test_wallet_transfer(local_chain):
358
352
359
353
# This transfer is expected to fail due to low balance
360
354
assert "❌ Not enough balance" in result .stdout
361
- print ("Testing wallet transfer, balance command ✅" )
362
-
363
- remove_wallets (wallet_path_alice )
364
- remove_wallets (wallet_path_bob )
365
- remove_wallets (wallet_path_anakin )
355
+ print ("✅Passed wallet transfer, balance command " )
0 commit comments