From 71c6fd49280415749a870c4d602cc97836a4b3f6 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 30 Jan 2023 21:06:46 +0100 Subject: [PATCH] feat: add convenience impl From Log (#2087) --- ethers-core/src/types/log.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ethers-core/src/types/log.rs b/ethers-core/src/types/log.rs index 3d055d56..03281f50 100644 --- a/ethers-core/src/types/log.rs +++ b/ethers-core/src/types/log.rs @@ -1,3 +1,4 @@ +use ethabi::RawLog; // Adapted from https://github.com/tomusdrw/rust-web3/blob/master/src/types/log.rs use crate::types::{Address, Bytes, H256, U256, U64}; use serde::{Deserialize, Serialize}; @@ -68,4 +69,10 @@ impl rlp::Encodable for Log { } } +impl From for RawLog { + fn from(val: Log) -> Self { + (val.topics, val.data.to_vec()).into() + } +} + // TODO: Implement more common types - or adjust this to work with all Tokenizable items