tessl install tessl/pypi-web3@7.13.0A Python library for interacting with Ethereum blockchain
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.01x
Baseline
Agent success rate without this tile
87%
Build a transaction event analyzer that processes blockchain transaction receipts and extracts event data with configurable error handling strategies.
Your analyzer should process transaction receipts and extract event logs with flexible error handling. Different scenarios require different approaches to handling decode failures:
The analyzer should:
@generates
from typing import Any, Dict, List, Literal
from web3.types import TxReceipt
ErrorHandlingMode = Literal["strict", "warn", "ignore", "discard"]
def process_receipt_events(
receipt: TxReceipt,
contract_abi: List[Dict[str, Any]],
error_handling: ErrorHandlingMode = "strict"
) -> List[Dict[str, Any]]:
"""
Process events from a transaction receipt with configurable error handling.
Args:
receipt: Transaction receipt containing event logs
contract_abi: Contract ABI defining the events to decode
error_handling: Error handling mode - "strict", "warn", "ignore", or "discard"
Returns:
List of decoded events, each containing event name and arguments
Raises:
Exception: In strict mode when event decoding fails
"""
passProvides Ethereum blockchain interaction capabilities including event processing with configurable error handling modes.