mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
util: add Ethereum to Networks enum
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user