From 5a814ce79714ccef2254014b9b1a122f3cebef4d Mon Sep 17 00:00:00 2001 From: Alex Pozhylenkov Date: Mon, 8 Apr 2024 14:54:55 +0300 Subject: [PATCH] add ToString impl for Network (#202) --- hermes/crates/cardano-chain-follower/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hermes/crates/cardano-chain-follower/src/lib.rs b/hermes/crates/cardano-chain-follower/src/lib.rs index 8b0d270b5..331703d29 100644 --- a/hermes/crates/cardano-chain-follower/src/lib.rs +++ b/hermes/crates/cardano-chain-follower/src/lib.rs @@ -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 for u64 { fn from(network: Network) -> Self { match network {