#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DeriveError {
#[error(transparent)]
Core(#[from] kobe_primitives::DeriveError),
#[error("bip32: {0}")]
Bip32(#[cfg_attr(feature = "std", from)] bitcoin::bip32::Error),
#[error("invalid private key")]
InvalidPrivateKey,
#[error("secp256k1: {0}")]
Secp256k1(#[cfg_attr(feature = "std", from)] bitcoin::secp256k1::Error),
}
#[cfg(not(feature = "std"))]
impl From<bitcoin::bip32::Error> for DeriveError {
fn from(e: bitcoin::bip32::Error) -> Self {
Self::Bip32(e)
}
}
#[cfg(not(feature = "std"))]
impl From<bitcoin::secp256k1::Error> for DeriveError {
fn from(e: bitcoin::secp256k1::Error) -> Self {
Self::Secp256k1(e)
}
}