From d8cd760449061fdb80a99d1bfb265cc9c2506c71 Mon Sep 17 00:00:00 2001 From: CyMule Date: Sat, 30 Apr 2022 09:08:58 -0400 Subject: [PATCH] Adds From trait to ValueOrArray The trait From for ValueOrArray was not implemented which prevented compilation when using pub fn address>>(self, address: T) for ethers_core::types::Filter. Fixes: #1199 --- ethers-core/src/types/log.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ethers-core/src/types/log.rs b/ethers-core/src/types/log.rs index 3815f1582a..62095d2020 100644 --- a/ethers-core/src/types/log.rs +++ b/ethers-core/src/types/log.rs @@ -1,6 +1,6 @@ // Adapted from https://github.com/tomusdrw/rust-web3/blob/master/src/types/log.rs use crate::{ - types::{Address, BlockNumber, Bytes, H256, U256, U64}, + types::{Address, BlockNumber, Bytes, H160, H256, U256, U64}, utils::keccak256, }; use serde::{ @@ -360,6 +360,12 @@ pub enum ValueOrArray { // TODO: Implement more common types - or adjust this to work with all Tokenizable items +impl From for ValueOrArray { + fn from(src: H160) -> Self { + ValueOrArray::Value(src) + } +} + impl From for ValueOrArray { fn from(src: H256) -> Self { ValueOrArray::Value(src)