Skip to content

Commit

Permalink
Merge pull request #2 from akjong/feat/log
Browse files Browse the repository at this point in the history
Add log convert
  • Loading branch information
Akagi201 authored Nov 26, 2024
2 parents 8bcaed3 + 07ee347 commit a69d373
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
12 changes: 12 additions & 0 deletions src/evm.rs
Original file line number Diff line number Diff line change
@@ -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<Log> {
let address = log_frame.address?;
let topics = log_frame.topics?;
let data = log_frame.data?;

LogData::new(topics, data).map(|data| Log { address, data })
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod block;
pub mod evm;
pub mod time;
pub mod transaction;

0 comments on commit a69d373

Please sign in to comment.