Skip to content

feat: add Any bound and as_any method to InvalidTxError trait#128

Merged
klkvr merged 4 commits intomainfrom
feat/add-any-bound-to-invalidtxerror
Jul 19, 2025
Merged

feat: add Any bound and as_any method to InvalidTxError trait#128
klkvr merged 4 commits intomainfrom
feat/add-any-bound-to-invalidtxerror

Conversation

@mattsse
Copy link
Member

@mattsse mattsse commented Jul 10, 2025

Adds Any trait bound to InvalidTxError and implements the as_any() method for downcasting trait objects back to their concrete types. This enables type-specific error handling when working with boxed InvalidTxError trait objects.

Changes

  • Added Any to the trait bounds of InvalidTxError
  • Added as_any(&self) -> &dyn Any method to the trait
  • Implemented as_any() for InvalidTransaction
  • Implemented as_any() for OpTransactionError (when op feature is enabled)

ref paradigmxyz/reth#17356

🤖 Generated with Claude Code

Enables downcasting of InvalidTxError trait objects back to their concrete types
for type-specific error handling.

Closes #17356

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

lgtm, we shouldn't need the as_any method with Rust 1.86

@klkvr klkvr merged commit 0a66973 into main Jul 19, 2025
@klkvr klkvr deleted the feat/add-any-bound-to-invalidtxerror branch July 19, 2025 21:09
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