//! Mod of types for ethereum logs use ethers_core::abi::Error; use ethers_core::abi::RawLog; /// A trait for types (events) that can be decoded from a `RawLog` pub trait EthLogDecode { /// decode from a `RawLog` fn decode_log(log: &RawLog) -> Result where Self: Sized; } /// Decodes a series of logs into a vector pub fn decode_logs(logs: &[RawLog]) -> Result, Error> { logs.iter().map(T::decode_log).collect() }