Skip to content

Make cast logs decode logs data when signature is provided - #16322

Open
e1Ru1o wants to merge 3 commits into
foundry-rs:masterfrom
e1Ru1o:e1Ru1o/logs
Open

Make cast logs decode logs data when signature is provided#16322
e1Ru1o wants to merge 3 commits into
foundry-rs:masterfrom
e1Ru1o:e1Ru1o/logs

Conversation

@e1Ru1o

@e1Ru1o e1Ru1o commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Motivation

  1. If the event signature is provided to cast logs including indexed parameters, it should be able to decode the logs instead of just showing topics and data.
  2. cast decode-event fails when the full event event signature is provided including the indexed parameters. It should be capable of dropping the indexed parameters and try to decode the event data, otherwise, users are forced to create the stripped signature manually.

Solution

Just do the decodings/strippings as needed and try to show the data to the user

  1. If len(topics) - 1 = len(indexed-params) try to decode the log
  2. If the signature contains indexed parameters drop them and try to decode the rest

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@github-actions

Copy link
Copy Markdown
Contributor

✅ Changelog found

The deterministic check will validate the changed entry.

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mablr I think this makes sense, perhaps we can do this without having to change a lot of existing code which makes this kinda hard to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants