use crate::*;
use holochain_zome_types::signature::Signature;
#[derive(Debug, thiserror::Error)]
pub enum KeystoreError {
#[error("SerializedBytesError: {0}")]
SerializedBytesError(#[from] SerializedBytesError),
#[error("Invalid signature {0:?}, for {1}")]
InvalidSignature(Signature, String),
#[error("Secure primitive error: {0}")]
SecurePrimitiveError(#[from] holochain_zome_types::SecurePrimitiveError),
#[error("Other: {0}")]
Other(String),
}
impl std::cmp::PartialEq for KeystoreError {
fn eq(&self, o: &Self) -> bool {
format!("{:?}", self) == format!("{:?}", o)
}
}
impl From<String> for KeystoreError {
fn from(e: String) -> Self {
KeystoreError::Other(e)
}
}
impl From<&String> for KeystoreError {
fn from(e: &String) -> Self {
e.to_string().into()
}
}
impl From<&str> for KeystoreError {
fn from(e: &str) -> Self {
e.to_string().into()
}
}