-
Notifications
You must be signed in to change notification settings - Fork 247
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
Impl TryFrom<alloy_rpc_types::Log> for alloy_primitives::Log #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! i have a nit:
@Evalir this ties back to the conversation we were having in telegram the other day. Should RPC types instead embed a primitive Log? |
@prestwich I think it should—this rpc type is a fuller version of the log object, and the additional APIs from the primitive log add additional safety. However, there's some work to do if we want to embed it here:
|
@Evalir Updated following your comment. Would you like I create an issue for the bigger refactoring you mentioned? I would be happy to work on this. |
Is there a good way to make it generic over encoded and decoded logs? E.g. can we achieve something like this
|
Came across the following use case:
Provider::get_logs()
that returns aVec
ofalloy_rpc_types::Log
SolEvent::decode_log_object()
that accept aalloy_primitives::Log
So I needed to convert
alloy_rpc_types::Log
toalloy_primitives::Log
, hence this PR.