fn parse_chaintype(s: &str) -> Result<ChainType, Error>