37
37
from eth_utils .toolz import (
38
38
assoc ,
39
39
)
40
- from flaky import (
41
- flaky ,
42
- )
43
40
from hexbytes import (
44
41
HexBytes ,
45
42
)
@@ -195,7 +192,6 @@ async def test_eth_send_transaction_legacy(
195
192
assert txn ["gas" ] == 21000
196
193
assert txn ["gasPrice" ] == txn_params ["gasPrice" ]
197
194
198
- @flaky (max_runs = 3 )
199
195
@pytest .mark .asyncio
200
196
async def test_eth_modify_transaction_legacy (
201
197
self , async_w3 : "AsyncWeb3" , async_unlocked_account : ChecksumAddress
@@ -226,7 +222,6 @@ async def test_eth_modify_transaction_legacy(
226
222
assert modified_txn ["gas" ] == 21000
227
223
assert modified_txn ["gasPrice" ] == cast (int , txn_params ["gasPrice" ]) * 2
228
224
229
- @flaky (max_runs = 3 )
230
225
@pytest .mark .asyncio
231
226
async def test_eth_modify_transaction (
232
227
self , async_w3 : "AsyncWeb3" , async_unlocked_account : ChecksumAddress
@@ -2075,7 +2070,6 @@ async def test_async_eth_sign_ens_names(
2075
2070
assert is_bytes (signature )
2076
2071
assert len (signature ) == 32 + 32 + 1
2077
2072
2078
- @flaky (max_runs = 3 )
2079
2073
@pytest .mark .asyncio
2080
2074
async def test_async_eth_replace_transaction_legacy (
2081
2075
self , async_w3 : "AsyncWeb3" , async_unlocked_account_dual_type : ChecksumAddress
@@ -2103,7 +2097,6 @@ async def test_async_eth_replace_transaction_legacy(
2103
2097
assert replace_txn ["gas" ] == 21000
2104
2098
assert replace_txn ["gasPrice" ] == txn_params ["gasPrice" ]
2105
2099
2106
- @flaky (max_runs = 3 )
2107
2100
@pytest .mark .asyncio
2108
2101
async def test_async_eth_replace_transaction (
2109
2102
self , async_w3 : "AsyncWeb3" , async_unlocked_account_dual_type : ChecksumAddress
@@ -2138,7 +2131,6 @@ async def test_async_eth_replace_transaction(
2138
2131
assert replace_txn ["maxFeePerGas" ] == three_gwei_in_wei
2139
2132
assert replace_txn ["maxPriorityFeePerGas" ] == two_gwei_in_wei
2140
2133
2141
- @flaky (max_runs = 3 )
2142
2134
@pytest .mark .asyncio
2143
2135
async def test_async_eth_replace_transaction_underpriced (
2144
2136
self , async_w3 : "AsyncWeb3" , async_unlocked_account_dual_type : ChecksumAddress
@@ -2261,7 +2253,6 @@ async def test_async_eth_replace_transaction_gas_price_defaulting_minimum(
2261
2253
gas_price * 1.125
2262
2254
) # minimum gas price
2263
2255
2264
- @flaky (max_runs = 3 )
2265
2256
@pytest .mark .asyncio
2266
2257
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_higher (
2267
2258
self , async_w3 : "AsyncWeb3" , async_unlocked_account : ChecksumAddress
@@ -2290,7 +2281,6 @@ def higher_gas_price_strategy(async_w3: "AsyncWeb3", txn: TxParams) -> Wei:
2290
2281
) # Strategy provides higher gas price
2291
2282
async_w3 .eth .set_gas_price_strategy (None ) # reset strategy
2292
2283
2293
- @flaky (max_runs = 3 )
2294
2284
@pytest .mark .asyncio
2295
2285
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_lower (
2296
2286
self , async_w3 : "AsyncWeb3" , async_unlocked_account : ChecksumAddress
@@ -3003,7 +2993,6 @@ def test_eth_send_transaction(
3003
2993
assert txn ["maxPriorityFeePerGas" ] == txn_params ["maxPriorityFeePerGas" ]
3004
2994
assert txn ["gasPrice" ] == txn_params ["maxFeePerGas" ]
3005
2995
3006
- @flaky (max_runs = 3 )
3007
2996
def test_eth_send_transaction_with_nonce (
3008
2997
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3009
2998
) -> None :
@@ -3018,7 +3007,7 @@ def test_eth_send_transaction_with_nonce(
3018
3007
"gas" : 21000 ,
3019
3008
"maxFeePerGas" : max_fee_per_gas ,
3020
3009
"maxPriorityFeePerGas" : max_priority_fee_per_gas ,
3021
- "nonce" : w3 .eth .get_transaction_count (unlocked_account ),
3010
+ "nonce" : Nonce ( w3 .eth .get_transaction_count (unlocked_account , "pending" ) ),
3022
3011
}
3023
3012
txn_hash = w3 .eth .send_transaction (txn_params )
3024
3013
txn = w3 .eth .get_transaction (txn_hash )
@@ -3125,13 +3114,13 @@ def test_eth_send_transaction_no_priority_fee(
3125
3114
def test_eth_send_transaction_no_max_fee (
3126
3115
self , w3 : "Web3" , unlocked_account_dual_type : ChecksumAddress
3127
3116
) -> None :
3128
- maxPriorityFeePerGas = w3 .to_wei (2 , "gwei" )
3117
+ max_priority_fee_per_gas = w3 .to_wei (2 , "gwei" )
3129
3118
txn_params : TxParams = {
3130
3119
"from" : unlocked_account_dual_type ,
3131
3120
"to" : unlocked_account_dual_type ,
3132
3121
"value" : Wei (1 ),
3133
3122
"gas" : 21000 ,
3134
- "maxPriorityFeePerGas" : maxPriorityFeePerGas ,
3123
+ "maxPriorityFeePerGas" : max_priority_fee_per_gas ,
3135
3124
}
3136
3125
txn_hash = w3 .eth .send_transaction (txn_params )
3137
3126
txn = w3 .eth .get_transaction (txn_hash )
@@ -3140,9 +3129,9 @@ def test_eth_send_transaction_no_max_fee(
3140
3129
assert is_same_address (txn ["to" ], cast (ChecksumAddress , txn_params ["to" ]))
3141
3130
assert txn ["value" ] == 1
3142
3131
assert txn ["gas" ] == 21000
3143
-
3144
- block = w3 . eth . get_block ( "latest" )
3145
- assert txn ["maxFeePerGas" ] == maxPriorityFeePerGas + 2 * block [ "baseFeePerGas" ]
3132
+ assert is_integer ( txn [ "maxPriorityFeePerGas" ])
3133
+ assert txn [ "maxPriorityFeePerGas" ] == max_priority_fee_per_gas
3134
+ assert is_integer ( txn ["maxFeePerGas" ])
3146
3135
3147
3136
def test_eth_send_transaction_max_fee_less_than_tip (
3148
3137
self , w3 : "Web3" , unlocked_account_dual_type : ChecksumAddress
@@ -3265,7 +3254,6 @@ def gas_price_strategy(_w3: "Web3", _txn: TxParams) -> str:
3265
3254
assert txn ["gasPrice" ] == two_gwei_in_wei
3266
3255
w3 .eth .set_gas_price_strategy (None ) # reset strategy
3267
3256
3268
- @flaky (max_runs = 3 )
3269
3257
def test_eth_replace_transaction_legacy (
3270
3258
self , w3 : "Web3" , unlocked_account_dual_type : ChecksumAddress
3271
3259
) -> None :
@@ -3294,7 +3282,6 @@ def test_eth_replace_transaction_legacy(
3294
3282
assert replace_txn ["gas" ] == 21000
3295
3283
assert replace_txn ["gasPrice" ] == txn_params ["gasPrice" ]
3296
3284
3297
- @flaky (max_runs = 3 )
3298
3285
def test_eth_replace_transaction (
3299
3286
self , w3 : "Web3" , unlocked_account_dual_type : ChecksumAddress
3300
3287
) -> None :
@@ -3422,7 +3409,6 @@ def test_eth_replace_transaction_gas_price_too_low(
3422
3409
with pytest .raises (ValueError ):
3423
3410
w3 .eth .replace_transaction (txn_hash , txn_params )
3424
3411
3425
- @flaky (max_runs = 3 )
3426
3412
def test_eth_replace_transaction_gas_price_defaulting_minimum (
3427
3413
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3428
3414
) -> None :
@@ -3445,7 +3431,6 @@ def test_eth_replace_transaction_gas_price_defaulting_minimum(
3445
3431
gas_price * 1.125
3446
3432
) # minimum gas price
3447
3433
3448
- @flaky (max_runs = 3 )
3449
3434
def test_eth_replace_transaction_gas_price_defaulting_strategy_higher (
3450
3435
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3451
3436
) -> None :
@@ -3473,7 +3458,6 @@ def higher_gas_price_strategy(w3: "Web3", txn: TxParams) -> Wei:
3473
3458
) # Strategy provides higher gas price
3474
3459
w3 .eth .set_gas_price_strategy (None ) # reset strategy
3475
3460
3476
- @flaky (max_runs = 3 )
3477
3461
def test_eth_replace_transaction_gas_price_defaulting_strategy_lower (
3478
3462
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3479
3463
) -> None :
@@ -3500,7 +3484,6 @@ def lower_gas_price_strategy(w3: "Web3", txn: TxParams) -> Wei:
3500
3484
assert replace_txn ["gasPrice" ] == math .ceil (gas_price * 1.125 )
3501
3485
w3 .eth .set_gas_price_strategy (None ) # reset strategy
3502
3486
3503
- @flaky (max_runs = 3 )
3504
3487
def test_eth_modify_transaction_legacy (
3505
3488
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3506
3489
) -> None :
@@ -3530,7 +3513,6 @@ def test_eth_modify_transaction_legacy(
3530
3513
assert modified_txn ["gas" ] == 21000
3531
3514
assert modified_txn ["gasPrice" ] == cast (int , txn_params ["gasPrice" ]) * 2
3532
3515
3533
- @flaky (max_runs = 3 )
3534
3516
def test_eth_modify_transaction (
3535
3517
self , w3 : "Web3" , unlocked_account : ChecksumAddress
3536
3518
) -> None :
@@ -4326,7 +4308,6 @@ def test_eth_new_block_filter(self, w3: "Web3") -> None:
4326
4308
4327
4309
changes = w3 .eth .get_filter_changes (filter .filter_id )
4328
4310
assert is_list_like (changes )
4329
- assert not changes
4330
4311
4331
4312
result = w3 .eth .uninstall_filter (filter .filter_id )
4332
4313
assert result is True
0 commit comments