mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
thiserror 2.0, cargo update
This commit is contained in:
@@ -18,7 +18,7 @@ workspace = true
|
||||
[dependencies]
|
||||
std-shims = { path = "../../../../common/std-shims", version = "^0.1.1", default-features = false }
|
||||
|
||||
thiserror = { version = "1", default-features = false, optional = true }
|
||||
thiserror = { version = "2", default-features = false }
|
||||
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
||||
|
||||
@@ -40,7 +40,7 @@ serde_json = { version = "1", default-features = false, features = ["alloc"] }
|
||||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
|
||||
|
||||
@@ -199,29 +199,25 @@ pub enum Network {
|
||||
}
|
||||
|
||||
/// Errors when decoding an address.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum AddressError {
|
||||
/// The address had an invalid (network, type) byte.
|
||||
#[cfg_attr(feature = "std", error("invalid byte for the address's network/type ({0})"))]
|
||||
#[error("invalid byte for the address's network/type ({0})")]
|
||||
InvalidTypeByte(u8),
|
||||
/// The address wasn't a valid Base58Check (as defined by Monero) string.
|
||||
#[cfg_attr(feature = "std", error("invalid address encoding"))]
|
||||
#[error("invalid address encoding")]
|
||||
InvalidEncoding,
|
||||
/// The data encoded wasn't the proper length.
|
||||
#[cfg_attr(feature = "std", error("invalid length"))]
|
||||
#[error("invalid length")]
|
||||
InvalidLength,
|
||||
/// The address had an invalid key.
|
||||
#[cfg_attr(feature = "std", error("invalid key"))]
|
||||
#[error("invalid key")]
|
||||
InvalidKey,
|
||||
/// The address was featured with unrecognized features.
|
||||
#[cfg_attr(feature = "std", error("unknown features"))]
|
||||
#[error("unknown features")]
|
||||
UnknownFeatures(u64),
|
||||
/// The network was for a different network than expected.
|
||||
#[cfg_attr(
|
||||
feature = "std",
|
||||
error("different network ({actual:?}) than expected ({expected:?})")
|
||||
)]
|
||||
#[error("different network ({actual:?}) than expected ({expected:?})")]
|
||||
DifferentNetwork {
|
||||
/// The Network expected.
|
||||
expected: Network,
|
||||
|
||||
Reference in New Issue
Block a user