diff --git a/ape_tenderly/provider.py b/ape_tenderly/provider.py index 2452811..a2d6933 100644 --- a/ape_tenderly/provider.py +++ b/ape_tenderly/provider.py @@ -1,23 +1,13 @@ import atexit - -from ape.api import PluginConfig, UpstreamProvider, Web3Provider, TestProviderAPI, TransactionAPI, ReceiptAPI -from ape.exceptions import ProviderError -from ape.logging import logger -from ape.utils import cached_property -from web3 import HTTPProvider, Web3 -from web3.gas_strategies.rpc import rpc_gas_price_strategy -from web3.middleware import geth_poa_middleware from typing import List, Optional, cast -from ape.types import ( - AddressType, -) - -from ape.exceptions import ( - VirtualMachineError, -) +from ape.api import PluginConfig, ReceiptAPI, TestProviderAPI, TransactionAPI, UpstreamProvider +from ape.exceptions import ProviderError, VirtualMachineError +from ape.logging import logger +from ape.types import AddressType from ape.utils import cached_property -from ethpm_types import HexBytes +from ape_ethereum.provider import Web3Provider +from eth_pydantic_types import HexBytes from web3 import HTTPProvider, Web3 from web3.gas_strategies.rpc import rpc_gas_price_strategy from web3.middleware import geth_poa_middleware @@ -33,8 +23,6 @@ class TenderlyConfig(PluginConfig): """The host address """ - - class TenderlyForkProvider(Web3Provider): @cached_property def _client(self) -> TenderlyClient: @@ -129,6 +117,7 @@ class TenderlyDevnetProvider(Web3Provider, TestProviderAPI): Docs: https://docs.tenderly.co/devnets/intro-to-devnets """ + _host: Optional[str] = None @cached_property @@ -144,7 +133,7 @@ def uri(self) -> str: self._host = config_host else: - raise ProviderError(f"Host not provided") + raise ProviderError("Host not provided.") return self._host @@ -270,4 +259,4 @@ def send_transaction(self, txn: TransactionAPI) -> ReceiptAPI: logger.info(f"Confirmed {receipt.txn_hash} (total fees paid = {receipt.total_fees_paid})") self.chain_manager.history.append(receipt) - return receipt \ No newline at end of file + return receipt