From e6a60cb86c61eea91224b3cd85aa9a2d109c3f4f Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 23 Dec 2024 11:42:42 -0600 Subject: [PATCH] fix: move sol to right spot, avoid breaking --- src/ape_ethereum/provider.py | 8 -------- src/ape_test/provider.py | 15 ++++++++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index d937257c91..dde8c84cf8 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -722,14 +722,6 @@ def get_receipt( def _create_receipt(self, **kwargs) -> ReceiptAPI: data = {"provider": self, **kwargs} - - if "block_number" not in data: - # Likely not a confirmed receipt. - data["block_number"] = 1 - if "status" not in data: - # May change if not yet confirmed. - data["status"] = TransactionStatusEnum.NO_ERROR - return self.network.ecosystem.decode_receipt(data) def get_transactions_by_block(self, block_id: "BlockID") -> Iterator[TransactionAPI]: diff --git a/src/ape_test/provider.py b/src/ape_test/provider.py index bdfb3eb0d5..c4f4d7bc87 100644 --- a/src/ape_test/provider.py +++ b/src/ape_test/provider.py @@ -35,6 +35,7 @@ from ape.utils.testing import DEFAULT_TEST_HD_PATH from ape_ethereum.provider import Web3Provider from ape_ethereum.trace import TraceApproach, TransactionTrace +from ape_ethereum.transactions import TransactionStatusEnum from ape_test.config import EthTesterProviderConfig if TYPE_CHECKING: @@ -342,11 +343,15 @@ def send_transaction(self, txn: "TransactionAPI") -> "ReceiptAPI": required_confirmations = txn.required_confirmations or 0 if vm_err or not self.auto_mine: - receipt = self._create_receipt( - required_confirmations=required_confirmations, - error=vm_err, - txn_hash=txn_hash, - ) + receipt_data = { + "block_number": -1, # Not yet confirmed, + "error": vm_err, + "provider": self, + "required_confirmations": required_confirmations, + "status": TransactionStatusEnum.NO_ERROR, + "txn_hash": txn_hash, + } + receipt = self.network.ecosystem.decode_receipt(receipt_data) else: txn_dict = txn_dict or txn.model_dump(mode="json")