Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jul 25, 2024
2 parents 953588c + f28157d commit 7b29563
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
21 changes: 10 additions & 11 deletions eth_defi/confirmation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@
import datetime
import logging
import time
from _decimal import Decimal
from typing import Dict, List, Set, Union, cast, Collection, TypeAlias
from typing import Collection, Dict, List, Set, TypeAlias, Union, cast

from _decimal import Decimal
from eth_account.datastructures import SignedTransaction
from eth_typing import HexStr, Address

from eth_defi.provider.anvil import mine, is_anvil
from eth_defi.provider.named import get_provider_name

from eth_defi.provider.anvil import is_anvil
from hexbytes import HexBytes
from web3 import Web3
from web3.exceptions import TransactionNotFound
from web3.providers import BaseProvider

from eth_defi.hotwallet import SignedTransactionWithNonce
from eth_defi.provider.anvil import mine
from eth_defi.provider.fallback import FallbackProvider, get_fallback_provider
from eth_defi.provider.named import get_provider_name
from eth_defi.timestamp import get_latest_block_timestamp
from eth_defi.tx import decode_signed_transaction
from eth_defi.provider.fallback import FallbackProvider, get_fallback_provider
from web3.providers import BaseProvider

from eth_defi.utils import to_unix_timestamp


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -196,7 +195,7 @@ def wait_transactions_to_complete(
logger.warning(
"Timeout warning threshold %s reached when trying to confirm txs, still trying:\n%s",
node_switch_timeout,
unconfirmed_txs
unconfirmed_txs,
)
provider.switch_provider()
next_node_switch = datetime.datetime.utcnow() + node_switch_timeout
Expand Down Expand Up @@ -605,7 +604,7 @@ def wait_and_broadcast_multiple_nodes(
# Initial broadcast of txs
for tx in txs:
try:
_broadcast_multiple_nodes(providers, tx, inter_node_delay=inter_node_delay,)
_broadcast_multiple_nodes(providers, tx)
last_exception = None
except NonRetryableBroadcastException:
# Don't try to handle
Expand Down
10 changes: 5 additions & 5 deletions tests/rpc/test_out_of_gas.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Out of gas tests."""

import os

import pytest

from eth_account import Account
from web3 import Web3, HTTPProvider
from web3 import HTTPProvider, Web3

from eth_defi.confirmation import wait_and_broadcast_multiple_nodes, OutOfGasFunds
from eth_defi.gas import estimate_gas_fees, apply_gas
from eth_defi.confirmation import OutOfGasFunds, wait_and_broadcast_multiple_nodes
from eth_defi.gas import apply_gas, estimate_gas_fees
from eth_defi.hotwallet import HotWallet
from eth_defi.provider.multi_provider import create_multi_provider_web3
from eth_defi.token import fetch_erc20_details, TokenDetails
from eth_defi.token import TokenDetails, fetch_erc20_details
from eth_defi.uniswap_v2.deployment import UniswapV2Deployment, fetch_deployment

JSON_RPC_POLYGON = os.environ.get("JSON_RPC_POLYGON", "https://polygon-rpc.com")
Expand Down

0 comments on commit 7b29563

Please sign in to comment.