From e2c0b6f81b3c242ac66b4e7cd56fa11af52ff09e Mon Sep 17 00:00:00 2001 From: Shuhui Luo <107524008+shuhuiluo@users.noreply.github.com> Date: Tue, 5 Nov 2024 23:50:31 -0500 Subject: [PATCH] feat: add `From` derive to `Currency` enum This update adds the `From` derive to the `Currency` enum to enable more convenient type conversions. It facilitates smoother integration by allowing conversions directly from component types. --- src/entities/currency.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entities/currency.rs b/src/entities/currency.rs index 76059e1..180d192 100644 --- a/src/entities/currency.rs +++ b/src/entities/currency.rs @@ -1,8 +1,8 @@ use crate::prelude::*; use alloy_primitives::ChainId; -use derive_more::Deref; +use derive_more::{Deref, From}; -#[derive(Clone, Debug, Hash, PartialEq, Eq)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, From)] pub enum Currency { NativeCurrency(Ether), Token(Token),