MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / parse_network_version

Function parse_network_version

fendermint/app/options/src/parse.rs:21–30  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

19const FIL_AMOUNT_NANO_DIGITS: u32 = 9;
20
21pub fn parse_network_version(s: &str) -> Result<NetworkVersion, String> {
22 let nv: u32 = s
23 .parse()
24 .map_err(|_| format!("`{s}` isn't a network version"))?;
25 if nv >= 21 {
26 Ok(NetworkVersion::from(nv))
27 } else {
28 Err("the minimum network version is 21".to_owned())
29 }
30}
31
32pub fn parse_token_amount(s: &str) -> Result<TokenAmount, String> {
33 BigInt::from_str_radix(s, 10)

Callers

nothing calls this directly

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected