We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks to salparadi at discord for providing the following code.
salparadi
from rich.tree import Tree from rich.text import Text from rich import print as rich_print from ape.utils.trace import TraceStyles def add_event_to_tree(event, tree: Tree): contract = ape.chain.contracts.get(event.contract_address) contract_name = getattr(contract, 'name', None) contract_address_styled = Text(event.contract_address, style="#D17706 italic") if contract_name: contract_name_styled = Text(contract_name, style=TraceStyles.CONTRACTS) contract_tree = tree.add(contract_name_styled + ' ' + contract_address_styled) else: contract_tree = tree.add(contract_address_styled) event_name_styled = Text(event.event_name) event_tree = contract_tree.add(event_name_styled) event_arguments = event.event_arguments.items() for arg, value in event_arguments: if isinstance(value, bytes): value = value.hex() event_arg_styled = Text(arg) event_value_styled = Text(str(value), style=TraceStyles.VALUE) event_tree.add(event_arg_styled + ': ' + event_value_styled) tree = Tree("Transaction Events for " + tx.txn_hash) for event in tx.events: add_event_to_tree(event, tree) rich_print(tree)
The text was updated successfully, but these errors were encountered:
APE-1619 Print event logs in a formatted way
Sorry, something went wrong.
this could probably be added to ReceiptAPI.show_trace()
ReceiptAPI.show_trace()
we need to adjust evm-trace so that events show up in the right spot in the call tree. also we have this tracked here #834
for this issue, we could add a receipts.show_events() method or something...
receipts.show_events()
Successfully merging a pull request may close this issue.
Overview
Thanks to
salparadi
at discord for providing the following code.Dependencies
The text was updated successfully, but these errors were encountered: