diff --git a/Cargo.toml b/Cargo.toml index 3008f70..d5f892a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy = { version = "0.6.4", features = ["full", "node-bindings", "rlp", "rpc-types-engine"] } +alloy = { version = "0.6.4", features = ["full", "node-bindings", "rlp", "rpc-types-engine", "rpc-types-trace"] } ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "8fbd8a53dca0170bedeca40a92ee70fd48c4615b" } reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" } diff --git a/src/evm.rs b/src/evm.rs new file mode 100644 index 0000000..db7055c --- /dev/null +++ b/src/evm.rs @@ -0,0 +1,12 @@ +use alloy::{ + primitives::{Log, LogData}, + rpc::types::trace::geth::CallLogFrame, +}; + +pub fn call_log_frame_to_log(log_frame: CallLogFrame) -> Option { + let address = log_frame.address?; + let topics = log_frame.topics?; + let data = log_frame.data?; + + LogData::new(topics, data).map(|data| Log { address, data }) +} diff --git a/src/lib.rs b/src/lib.rs index b429453..b9ec767 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ pub mod block; +pub mod evm; pub mod time; pub mod transaction;