From 0a105db2fe8247f22ba1f419f9ca736248918de8 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Tue, 26 Oct 2021 16:33:28 +0300 Subject: [PATCH] util: add Ethereum to Networks enum --- src/service/eth.rs | 4 ++-- src/util/net_name.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/service/eth.rs b/src/service/eth.rs index 5b26930c5..e721cfe95 100644 --- a/src/service/eth.rs +++ b/src/service/eth.rs @@ -242,8 +242,8 @@ impl EthClient { send_notification .send(TokenNotification { - network: NetworkName::Solana, - token_id: generate_id(ETH_NATIVE_TOKEN_ID, &NetworkName::Solana)?, + network: NetworkName::Ethereum, + token_id: generate_id(ETH_NATIVE_TOKEN_ID, &NetworkName::Ethereum)?, drk_pub_key, // TODO FIX received_balance: amnt.to_u64_digits()[0], diff --git a/src/util/net_name.rs b/src/util/net_name.rs index 97dba7c12..28c08bcb4 100644 --- a/src/util/net_name.rs +++ b/src/util/net_name.rs @@ -9,6 +9,7 @@ use crate::{ pub enum NetworkName { Solana, Bitcoin, + Ethereum, Empty, } @@ -21,6 +22,9 @@ impl std::fmt::Display for NetworkName { Self::Bitcoin => { write!(f, "Bitcoin") } + Self::Ethereum => { + write!(f, "Ethereum") + } Self::Empty => { write!(f, "No Supported Network") } @@ -35,6 +39,7 @@ impl FromStr for NetworkName { match s.to_lowercase().as_str() { "sol" | "solana" => Ok(NetworkName::Solana), "btc" | "bitcoin" => Ok(NetworkName::Bitcoin), + "eth" | "ethereum" => Ok(NetworkName::Ethereum), _ => Err(crate::Error::NotSupportedNetwork), } }