From 39937abf4db0b5e6f39404995c7a22bfb02d582c Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Wed, 4 Dec 2024 06:20:40 +0000 Subject: [PATCH] chore: refactor evmspec --- dank_mids/controller.py | 2 +- dank_mids/eth.py | 15 ++++++++------- dank_mids/types.py | 7 +++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dank_mids/controller.py b/dank_mids/controller.py index 9632075b..b93dba1e 100644 --- a/dank_mids/controller.py +++ b/dank_mids/controller.py @@ -6,7 +6,7 @@ import eth_retry from cchecksum import to_checksum_address from eth_typing import BlockNumber, ChecksumAddress -from evmspec._ids import ChainId +from evmspec.data import ChainId from msgspec import Struct from multicall.constants import MULTICALL2_ADDRESSES, MULTICALL_ADDRESSES from multicall.multicall import NotSoBrightBatcher diff --git a/dank_mids/eth.py b/dank_mids/eth.py index 63f80e8b..6decec57 100644 --- a/dank_mids/eth.py +++ b/dank_mids/eth.py @@ -16,10 +16,11 @@ from async_property import async_cached_property from eth_typing import BlockNumber from evmspec import AnyTransaction, FilterTrace, Transaction, TransactionRLP, TransactionReceipt -from evmspec.block import TinyBlock -from evmspec.data import TransactionHash, UnixTimestamp, _DecodeHook, _decode_hook -from evmspec.log import Log -from evmspec.receipt import Status +from evmspec.data import TransactionHash, UnixTimestamp, _decode_hook +from evmspec.data._main import DecodeHook +from evmspec.structs.block import TinyBlock +from evmspec.structs.log import Log +from evmspec.structs.receipt import Status from msgspec import Raw, Struct, ValidationError, json from web3._utils.blocks import select_method_for_block_identifier from web3._utils.rpc_abi import RPC @@ -137,7 +138,7 @@ async def get_transaction_receipt( self, *args, decode_to: Type[T] = TransactionReceipt, - decode_hook: _DecodeHook[T] = _decode_hook, + decode_hook: DecodeHook[T] = _decode_hook, **kwargs, ) -> T: """ @@ -173,7 +174,7 @@ async def trace_filter( self, filter_params: TraceFilterParams, decode_to: Type[T] = List[FilterTrace], - decode_hook: _DecodeHook[T] = _decode_hook, + decode_hook: DecodeHook[T] = _decode_hook, ) -> T: """ Returns all traces matching a filter. If the decoding to the specified @@ -249,7 +250,7 @@ async def get_logs( self, *args, decode_to: Type[T] = Tuple[Log, ...], # type: ignore [assignment] - decode_hook: _DecodeHook[T] = _decode_hook, + decode_hook: DecodeHook[T] = _decode_hook, **kwargs, ) -> T: """ diff --git a/dank_mids/types.py b/dank_mids/types.py index 611b9742..15f3b7a4 100644 --- a/dank_mids/types.py +++ b/dank_mids/types.py @@ -28,10 +28,9 @@ import evmspec from dictstruct import DictStruct from eth_typing import ChecksumAddress, HexStr -from evmspec._ids import ChainId -from evmspec.block import BaseBlock, Block, MinedBlock, ShanghaiCapellaBlock -from evmspec.data import Address, BlockNumber, Wei, uint, _decode_hook -from evmspec.log import Log +from evmspec.data import Address, BlockNumber, ChainId, Wei, uint, _decode_hook +from evmspec.structs.block import BaseBlock, Block, MinedBlock, ShanghaiCapellaBlock +from evmspec.structs.log import Log from hexbytes import HexBytes from msgspec import UNSET, Raw, ValidationError, json from web3.datastructures import AttributeDict