Skip to content

Commit

Permalink
refactor!: TraceAPI (ApeWorX#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Apr 22, 2024
1 parent 4ec4b9c commit 4308794
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
6 changes: 6 additions & 0 deletions docs/userguides/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ ethereum:
## Traces
<<<<<<< HEAD
<<<<<<< HEAD
Transaction traces are the steps in the contract the transaction took.
Traces both power a myriad of features in Ape as well are themselves a tool for developers to use to debug transactions.
Expand Down Expand Up @@ -298,6 +299,11 @@ It will output tables of contracts and methods with gas usages that look like th
│ mint 1 25845 25845 25845 25845
```
>>>>>>> 49929845d (refactor!: rename geth to node (#1982))
=======
Transaction traces are the steps in the contract the transaction took.
Traces both power a myriad of features in Ape as well are themselves a tool for developers to use to debug transactions.
To learn more about traces, see the [traces userguide](./trace.md).
>>>>>>> 8cbef2689 (refactor!: TraceAPI (#1864))

## Estimate Gas Cost

Expand Down
3 changes: 1 addition & 2 deletions src/ape_ethereum/ecosystem.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re
from collections.abc import Iterator, Sequence
from decimal import Decimal
from functools import cached_property
from typing import Any, ClassVar, Optional, Union, cast
from typing import Any, ClassVar, Iterator, Optional, Sequence, Union, cast

from eth_abi import decode, encode
from eth_abi.exceptions import InsufficientDataBytes, NonEmptyPaddingBytes
Expand Down
6 changes: 1 addition & 5 deletions src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def _eth_call(self, arguments: list) -> HexBytes:
return HexBytes(result)

def _prepare_call(self, txn: Union[dict, TransactionAPI], **kwargs) -> list:
# NOTE: Using mode="json" because used as request data.
# NOTE: Using mode="json" because used in request data.
txn_dict = (
txn.model_dump(by_alias=True, mode="json") if isinstance(txn, TransactionAPI) else txn
)
Expand Down Expand Up @@ -850,7 +850,6 @@ def fetch_log_page(block_range):

# NOTE: Using JSON mode since used as request data.
filter_params = page_filter.model_dump(mode="json")

logs = self.make_request("eth_getLogs", [filter_params])
return self.network.ecosystem.decode_logs(logs, *log_filter.events)

Expand Down Expand Up @@ -1147,9 +1146,6 @@ class EthereumNodeProvider(Web3Provider, ABC):

name: str = "node"

"""Is ``None`` until known."""
can_use_parity_traces: Optional[bool] = None

@property
def uri(self) -> str:
if "url" in self.provider_settings:
Expand Down
9 changes: 0 additions & 9 deletions tests/functional/geth/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ def test_repr_on_live_network_and_disconnected(networks):
assert actual == expected


@geth_process_test
def test_get_logs(geth_contract, geth_account):
geth_contract.setNumber(101010, sender=geth_account)
actual = geth_contract.NumberChange[-1]
assert actual.event_name == "NumberChange"
assert actual.contract_address == geth_contract.address
assert actual.event_arguments["newNum"] == 101010


@geth_process_test
def test_chain_id_when_connected(geth_provider):
assert geth_provider.chain_id == 1337
Expand Down

0 comments on commit 4308794

Please sign in to comment.