Use middleware for trace and receipt methods

This commit is contained in:
Luke Van Seters
2021-12-23 22:21:18 -05:00
parent 2982ff700f
commit fcc453391f
5 changed files with 38 additions and 32 deletions

16
mev_inspect/methods.py Normal file
View File

@@ -0,0 +1,16 @@
from typing import Callable, List
from web3._utils.rpc_abi import RPC
from web3.method import Method, default_root_munger
from web3.types import BlockIdentifier, ParityBlockTrace, RPCEndpoint
trace_block: Method[Callable[[BlockIdentifier], List[ParityBlockTrace]]] = Method(
RPC.trace_block,
mungers=[default_root_munger],
)
get_block_receipts: Method[Callable[[BlockIdentifier], List[dict]]] = Method(
RPCEndpoint("eth_getBlockReceipts"),
mungers=[default_root_munger],
)