(input: &str)
| 36 | type Err = CryptoError; |
| 37 | |
| 38 | fn from_str(input: &str) -> Result<CryptoAlgorithm> { |
| 39 | match input.to_lowercase().as_str() { |
| 40 | "ed25519" => Ok(CryptoAlgorithm::Ed25519), |
| 41 | "secp256k1" => Ok(CryptoAlgorithm::Secp256k1), |
| 42 | "secp256r1" => Ok(CryptoAlgorithm::Secp256r1), |
| 43 | "eip191" => Ok(CryptoAlgorithm::Eip191), |
| 44 | "cosmos_adr36" => Ok(CryptoAlgorithm::CosmosAdr36), |
| 45 | _ => Err(SignatureError::AlgorithmError(input.to_string()).into()), |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | impl std::fmt::Display for CryptoAlgorithm { |
nothing calls this directly
no outgoing calls
no test coverage detected