Skip to content

Commit

Permalink
add ToString impl for Network (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Apr 8, 2024
1 parent 4a239eb commit 5a814ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hermes/crates/cardano-chain-follower/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ impl FromStr for Network {
}
}

impl ToString for Network {
fn to_string(&self) -> String {
match self {
Network::Mainnet => "mainnet".to_string(),
Network::Preprod => "preprod".to_string(),
Network::Preview => "preview".to_string(),
Network::Testnet => "testnet".to_string(),
}
}
}

impl From<Network> for u64 {
fn from(network: Network) -> Self {
match network {
Expand Down

0 comments on commit 5a814ce

Please sign in to comment.