web3-address 0.4.0

Address type for web3 public keys
Documentation
//! Errors generated by the address library.
use thiserror::Error;

/// Error thrown by the address library.
#[derive(Debug, Error)]
pub enum Error {
    /// Error generated when an address has the wrong prefix.
    #[error("address must begin with 0x")]
    BadAddressPrefix,

    /// Error generated converting to fixed length slice.
    #[error(transparent)]
    TryFromSlice(#[from] std::array::TryFromSliceError),

    /// Error generated by the ECDSA library.
    #[cfg(feature = "ethereum")]
    #[error(transparent)]
    Ecdsa(#[from] k256::ecdsa::Error),

    /// Error generated by elliptic curve library.
    #[cfg(feature = "ethereum")]
    #[error(transparent)]
    Elliptic(#[from] k256::elliptic_curve::Error),

    /// Error generated parsing from hex.
    #[cfg(feature = "ethereum")]
    #[error(transparent)]
    Hex(#[from] hex::FromHexError),
}