diff --git a/ape_tenderly/provider.py b/ape_tenderly/provider.py index 95531ef..934d169 100644 --- a/ape_tenderly/provider.py +++ b/ape_tenderly/provider.py @@ -10,15 +10,13 @@ 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 @@ -34,8 +32,6 @@ class TenderlyConfig(PluginConfig): """The host address """ - - class TenderlyForkProvider(Web3Provider): @cached_property def _client(self) -> TenderlyClient: @@ -130,6 +126,7 @@ class TenderlyDevnetProvider(Web3Provider, TestProviderAPI): Docs: https://docs.tenderly.co/devnets/intro-to-devnets """ + _host: Optional[str] = None @cached_property @@ -145,7 +142,7 @@ def uri(self) -> str: self._host = config_host else: - raise ProviderError(f"Host not provided") + raise ProviderError("Host not provided.") return self._host @@ -271,4 +268,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