mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Remove derive_more (#1600)
* replace derive_more's 'From' in signer * replace derive_more's 'From' in core * Remove `derive_more`'s `Display` usages (#1601) * Remove derive_more's 'Display' from core * Remove derive_more's 'Display' from metadata * Remove derive_more's 'Display' from signer * Remove derive_more from dependencies (#1602) closes #1503 * Update signer/src/eth.rs Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * rename convert_error to impl_from * rename convert_error to impl_from in core --------- Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
@@ -6,12 +6,13 @@
|
||||
//! This doesn't contain much functionality itself, but is easy to convert to/from an `sp_core::AccountId32`
|
||||
//! for instance, to gain functionality without forcing a dependency on Substrate crates here.
|
||||
|
||||
use core::fmt::Display;
|
||||
|
||||
use alloc::format;
|
||||
use alloc::string::String;
|
||||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
use codec::{Decode, Encode};
|
||||
use derive_more::Display;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// A 32-byte cryptographic identifier. This is a simplified version of Substrate's
|
||||
@@ -105,19 +106,26 @@ impl AccountId32 {
|
||||
}
|
||||
|
||||
/// An error obtained from trying to interpret an SS58 encoded string into an AccountId32
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug, Display)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum FromSs58Error {
|
||||
#[display(fmt = "Base 58 requirement is violated")]
|
||||
BadBase58,
|
||||
#[display(fmt = "Length is bad")]
|
||||
BadLength,
|
||||
#[display(fmt = "Invalid checksum")]
|
||||
InvalidChecksum,
|
||||
#[display(fmt = "Invalid SS58 prefix byte.")]
|
||||
InvalidPrefix,
|
||||
}
|
||||
|
||||
impl Display for FromSs58Error {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
match self {
|
||||
FromSs58Error::BadBase58 => write!(f, "Base 58 requirement is violated"),
|
||||
FromSs58Error::BadLength => write!(f, "Length is bad"),
|
||||
FromSs58Error::InvalidChecksum => write!(f, "Invalid checksum"),
|
||||
FromSs58Error::InvalidPrefix => write!(f, "Invalid SS58 prefix byte."),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl std::error::Error for FromSs58Error {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user