-
Notifications
You must be signed in to change notification settings - Fork 554
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
refactor(log): use alloy_primitives::Log #975
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.
pls remove alloy_rlp
and fmt per clippy/fmt lints
should be ready now |
crates/revm/src/evm.rs
Outdated
topics, | ||
data, | ||
data: LogData::new(topics, data) | ||
.expect("Invalid LogData: Number of topics should be <= 4"), |
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.
Would refactor Host::log
function input to a LogData
.
in essence change this: https://github.com/bluealloy/revm/blob/main/crates/interpreter/src/instructions/host.rs#L214
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.
yea that's nicer
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.
I didn't notice as the code was not changed but we could use Log
directly in place of LogData
. Other parts lgtm
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.
could you clarify that last comment? not clear on what you're meaning
crates/interpreter/src/host.rs
Outdated
/// Emit a log owned by `address` with given `topics` and `data`. | ||
fn log(&mut self, address: Address, topics: Vec<B256>, data: Bytes); | ||
/// Emit a log owned by `address` with given `LogData`. | ||
fn log(&mut self, address: Address, log_data: LogData); |
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.
fn log(&mut self, address: Address, log_data: LogData); | |
fn log(&mut self, log: Log); |
Log
contains both Address
and LogData
.
@slordua i meant this
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.
ah ok i see it thx, will revise shortly
is .expect ok? topics shouldn't exceed 4 right? also wasn't sure if docs comment needed changing, still seemed appropriate to me perhaps tho... /// Emit a would be better... idk |
It is fine, lgtm |
No description provided.