util: add Ethereum to Networks enum

This commit is contained in:
ghassmo
2021-10-26 16:33:28 +03:00
parent d38b0808a0
commit 0a105db2fe
2 changed files with 7 additions and 2 deletions

View File

@@ -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],

View File

@@ -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),
}
}