"tb" => Ok(Currency::BitcoinTestnet),
"bcrt" => Ok(Currency::Regtest),
"sb" => Ok(Currency::Simnet),
+ "tbs" => Ok(Currency::Signet),
_ => Err(ParseError::UnknownCurrency)
}
}
assert_eq!("tb".parse::<Currency>(), Ok(Currency::BitcoinTestnet));
assert_eq!("bcrt".parse::<Currency>(), Ok(Currency::Regtest));
assert_eq!("sb".parse::<Currency>(), Ok(Currency::Simnet));
+ assert_eq!("tbs".parse::<Currency>(), Ok(Currency::Signet));
assert_eq!("something_else".parse::<Currency>(), Err(ParseError::UnknownCurrency))
}
Currency::BitcoinTestnet => "tb",
Currency::Regtest => "bcrt",
Currency::Simnet => "sb",
+ Currency::Signet => "tbs",
};
write!(f, "{}", currency_code)
}
assert_eq!("tb", Currency::BitcoinTestnet.to_string());
assert_eq!("bcrt", Currency::Regtest.to_string());
assert_eq!("sb", Currency::Simnet.to_string());
+ assert_eq!("tbs", Currency::Signet.to_string());
}
#[test]