Skip to content
New issue

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

decode events #125

Merged
merged 1 commit into from
Dec 6, 2024
Merged

decode events #125

merged 1 commit into from
Dec 6, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Dec 6, 2024

TL;DR

Added event decoding functionality for Ethereum logs, enabling the parsing and interpretation of indexed and non-indexed event parameters.

What changed?

  • Added ConstructEventABI function to parse event signatures into ABI format
  • Implemented log decoding functionality to handle both indexed and non-indexed event parameters
  • Created new DecodedLog and DecodedLogData structures to represent decoded event data
  • Enhanced log handlers to support automatic event decoding when a signature is provided
  • Added support for converting various data types (bytes, numerics) to hexadecimal format

How to test?

  1. Make a GET request to /{chainId}/events/{contract}/{signature} with a valid event signature
  2. Verify that the response includes decoded event data with:
    • Event name and signature
    • Indexed parameters properly decoded
    • Non-indexed parameters converted to appropriate formats
    • All byte and numeric values properly converted to hex

Why make this change?

To improve the readability and usability of event log data by automatically decoding raw event parameters into their proper types and formats. This makes it easier for developers to work with and understand event data without having to manually decode the raw logs.

Copy link
Collaborator Author

iuwqyir commented Dec 6, 2024

@iuwqyir iuwqyir marked this pull request as ready for review December 6, 2024 13:04
@iuwqyir iuwqyir force-pushed the 12-06-decode_transaction_inputs branch from 226bdae to d3ab46d Compare December 6, 2024 13:39
@iuwqyir iuwqyir force-pushed the 12-06-decode_events branch 2 times, most recently from 129144c to 532682c Compare December 6, 2024 13:59
@iuwqyir iuwqyir force-pushed the 12-06-decode_events branch from 532682c to c2be0ad Compare December 6, 2024 19:27
Copy link
Collaborator Author

iuwqyir commented Dec 6, 2024

Merge activity

  • Dec 6, 2:56 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 6, 3:00 PM EST: Graphite rebased this pull request as part of a merge.
  • Dec 6, 3:01 PM EST: A user merged this pull request with Graphite.

@iuwqyir iuwqyir changed the base branch from 12-06-decode_transaction_inputs to graphite-base/125 December 6, 2024 19:57
@iuwqyir iuwqyir changed the base branch from graphite-base/125 to main December 6, 2024 19:58
@iuwqyir iuwqyir force-pushed the 12-06-decode_events branch from c2be0ad to 0872cf9 Compare December 6, 2024 19:59
@iuwqyir iuwqyir merged commit 6b6d94f into main Dec 6, 2024
5 checks passed
@iuwqyir iuwqyir deleted the 12-06-decode_events branch December 6, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants