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 75fc0d0 commit 6e76046
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ape_tenderly/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,8 +32,6 @@ class TenderlyConfig(PluginConfig):
"""The host address """




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

_host: Optional[str] = None

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

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

0 comments on commit 6e76046

Please sign in to comment.