Skip to content

Commit

Permalink
refactor: 0.7.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NotPeopling2day committed Dec 19, 2023
1 parent 4b47bc6 commit eda49e7
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions ape_tenderly/provider.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -33,8 +23,6 @@ class TenderlyConfig(PluginConfig):
"""The host address """




class TenderlyForkProvider(Web3Provider):
@cached_property
def _client(self) -> TenderlyClient:
Expand Down Expand Up @@ -129,6 +117,7 @@ class TenderlyDevnetProvider(Web3Provider, TestProviderAPI):
Docs: https://docs.tenderly.co/devnets/intro-to-devnets
"""

_host: Optional[str] = None

@cached_property
Expand All @@ -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

Expand Down Expand Up @@ -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
return receipt

0 comments on commit eda49e7

Please sign in to comment.