Skip to content

Commit

Permalink
chore: refactor evmspec
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Dec 4, 2024
1 parent 134a06a commit 223c58b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions y/_db/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@


@final
class Log(evmspec.log.Log, frozen=True, kw_only=True, array_like=True):
class Log(evmspec.Log, frozen=True, kw_only=True, array_like=True):
"""
Extends :class:`~evmspec.log.Log` with additional configuration for immutability,
Extends :class:`evmspec.Log` with additional configuration for immutability,
keyword-only arguments, and array-like encoding behavior using :class:`msgspec.Struct`.
This class is designed to behave like a tuple specifically during `msgspec.json`
Expand All @@ -29,6 +29,6 @@ class Log(evmspec.log.Log, frozen=True, kw_only=True, array_like=True):
>>> print(log_tuple)
See Also:
- :class:`~evmspec.log.Log` for the base class implementation.
- :class:`evmspec.Log` for the base class implementation.
- :class:`msgspec.Struct` for details on the `array_like` feature.
"""
4 changes: 2 additions & 2 deletions y/_db/utils/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from async_lru import alru_cache
from brownie import chain
from brownie.network.event import _EventItem
from eth_typing import ChecksumAddress, HexStr
from eth_typing import HexStr
from evmspec.data import Address, HexBytes32, uint
from evmspec.log import Topic
from evmspec.structs.log import Topic
from hexbytes import HexBytes
from msgspec import json, ValidationError
from pony.orm import commit, db_session, select
Expand Down
4 changes: 2 additions & 2 deletions y/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dank_mids.brownie_patch.call
import eth_event.main
import eth_utils
import evmspec.data
import evmspec.data._main
import multicall.call
import web3._utils as web3_utils
import web3.main as web3_main
Expand Down Expand Up @@ -245,7 +245,7 @@ def _monkey_patch_dependencies():
eth_utils.address.to_checksum_address = to_address

# this monkey patches evmspec's Address decode hook with our lru cache
evmspec.data.to_checksum_address = to_address
evmspec.data._main.to_checksum_address = to_address

# this monkey patches multicall.Call.target checksumming with our lru cache
multicall.call.to_checksum_address = to_address
Expand Down
4 changes: 2 additions & 2 deletions y/utils/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
EventDict,
)
from eth_typing import ChecksumAddress
from evmspec.log import Log
from evmspec import Log
from msgspec.structs import force_setattr
from toolz import groupby
from web3.middleware.filter import block_ranges
Expand Down Expand Up @@ -71,7 +71,7 @@ def decode_logs(logs: Union[Iterable[LogReceipt], Iterable[Log]]) -> EventDict:
Decode logs to events and enrich them with additional info.
Args:
logs: An iterable of :class:`~web3.types.LogReceipt` or :class:`~evmspec.log.Log` objects.
logs: An iterable of :class:`~web3.types.LogReceipt` or :class:`~evmspec.Log` objects.
Returns:
An :class:`~brownie.network.event.EventDict` containing decoded events.
Expand Down

0 comments on commit 223c58b

Please sign in to comment.