@@ -70,28 +70,25 @@ def test_wallet_import(wallet_data):
70
70
@pytest .mark .e2e
71
71
def test_wallet_transfer (imported_wallet ):
72
72
"""Test wallet transfer."""
73
- try :
74
- imported_wallet .faucet ().wait ()
75
- except FaucetLimitReachedError :
76
- print ("Faucet limit reached, continuing..." )
77
-
78
73
destination_wallet = Wallet .create ()
79
74
80
- initial_source_balance = Decimal (str (imported_wallet .balances ().get ("eth" , 0 )))
81
- initial_dest_balance = Decimal (str (destination_wallet .balances ().get ("eth" , 0 )))
75
+ initial_source_balance = imported_wallet .balance ("eth" )
76
+ initial_dest_balance = destination_wallet .balance ("eth" )
77
+
78
+ if initial_source_balance < 0.0001 :
79
+ try :
80
+ imported_wallet .faucet ().wait ()
81
+ except FaucetLimitReachedError :
82
+ print ("Faucet limit reached, continuing..." )
82
83
83
84
transfer = imported_wallet .transfer (
84
85
amount = Decimal ("0.000000001" ), asset_id = "eth" , destination = destination_wallet
85
- )
86
-
87
- transfer .wait ()
88
- time .sleep (2 )
86
+ ).wait ()
89
87
90
- assert transfer is not None
91
88
assert transfer .status .value == "complete"
92
89
93
- final_source_balance = Decimal ( str ( imported_wallet .balances (). get ( "eth" , 0 )) )
94
- final_dest_balance = Decimal ( str ( destination_wallet .balances (). get ( "eth" , 0 )) )
90
+ final_source_balance = imported_wallet .balance ( "eth" )
91
+ final_dest_balance = destination_wallet .balance ( "eth" )
95
92
96
93
assert final_source_balance < initial_source_balance
97
94
assert final_dest_balance > initial_dest_balance
@@ -100,15 +97,17 @@ def test_wallet_transfer(imported_wallet):
100
97
@pytest .mark .e2e
101
98
def test_transaction_history (imported_wallet ):
102
99
"""Test transaction history retrieval."""
103
- try :
104
- imported_wallet .faucet ().wait ()
105
- except FaucetLimitReachedError :
106
- print ("Faucet limit reached, continuing..." )
107
-
108
100
destination_wallet = Wallet .create ()
109
101
102
+ initial_source_balance = imported_wallet .balance ("eth" )
103
+ if initial_source_balance < 0.0001 :
104
+ try :
105
+ imported_wallet .faucet ().wait ()
106
+ except FaucetLimitReachedError :
107
+ print ("Faucet limit reached, continuing..." )
108
+
110
109
transfer = imported_wallet .transfer (
111
- amount = Decimal ("0.0001 " ), asset_id = "eth" , destination = destination_wallet
110
+ amount = Decimal ("0.000000001 " ), asset_id = "eth" , destination = destination_wallet
112
111
).wait ()
113
112
114
113
time .sleep (10 )
0 commit comments