Skip to content

Commit

Permalink
test: integy test
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 21, 2024
1 parent 7566e45 commit 38746f4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
1 change: 0 additions & 1 deletion ape_alchemy/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from ape.logging import logger
from ape.types import BlockID
from ape_ethereum.provider import Web3Provider
from ape_ethereum.trace import TransactionTrace
from ape_ethereum.transactions import AccessList
from eth_pydantic_types import HexBytes
from eth_typing import HexStr
Expand Down
5 changes: 2 additions & 3 deletions ape_alchemy/trace.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from functools import cached_property
from typing import Any, Optional
from hexbytes import HexBytes

from ape_ethereum.trace import TransactionTrace, TraceApproach
from evm_trace import CallTreeNode
from ape_ethereum.trace import TraceApproach, TransactionTrace
from hexbytes import HexBytes


class AlchemyTransactionTrace(TransactionTrace):
Expand Down
24 changes: 24 additions & 0 deletions tests/test_trace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pytest
from ape import chain, networks


@pytest.fixture(autouse=True)
def ethereum_mainnet_alchemy():
with networks.ethereum.mainnet.use_provider("alchemy"):
yield


def test_revert_message():
txn_hash = "0x36144f609e0fc7afd3cc570d6a54582091642a44c5223a5ad59aa20008dd9577"
receipt = chain.history[txn_hash]
actual = receipt.trace.revert_message
expected = "UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT"
assert actual == expected


def test_return_value():
txn_hash = "0xe0897d735b67893648b20085ecef16232733425329df844292d5b2774cca436b"
receipt = chain.history[txn_hash]
actual = receipt.return_value
expected = 1244617160572980465
assert actual == expected

0 comments on commit 38746f4

Please sign in to comment.