mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 19:49:22 +00:00
thiserror 2.0, cargo update
This commit is contained in:
parent
3192370484
commit
18897978d0
35 changed files with 645 additions and 667 deletions
1075
Cargo.lock
generated
1075
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -18,7 +18,7 @@ workspace = true
|
|||
|
||||
[dependencies]
|
||||
spin = { version = "0.9", default-features = false, features = ["use_ticket_mutex", "lazy"] }
|
||||
hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] }
|
||||
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher", "inline-more"] }
|
||||
|
||||
[features]
|
||||
std = []
|
||||
|
|
|
@ -8,6 +8,7 @@ authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
|||
keywords = []
|
||||
edition = "2021"
|
||||
publish = false
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
|
|
@ -6,6 +6,7 @@ license = "AGPL-3.0-only"
|
|||
repository = "https://github.com/serai-dex/serai/tree/develop/coordinator/tributary"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -16,7 +17,7 @@ workspace = true
|
|||
|
||||
[dependencies]
|
||||
async-trait = { version = "0.1", default-features = false }
|
||||
thiserror = { version = "1", default-features = false }
|
||||
thiserror = { version = "2", default-features = false, features = ["std"] }
|
||||
|
||||
subtle = { version = "^2", default-features = false, features = ["std"] }
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["std"] }
|
||||
|
|
|
@ -6,6 +6,7 @@ license = "MIT"
|
|||
repository = "https://github.com/serai-dex/serai/tree/develop/coordinator/tendermint"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -16,7 +17,7 @@ workspace = true
|
|||
|
||||
[dependencies]
|
||||
async-trait = { version = "0.1", default-features = false }
|
||||
thiserror = { version = "1", default-features = false }
|
||||
thiserror = { version = "2", default-features = false, features = ["std"] }
|
||||
|
||||
hex = { version = "0.4", default-features = false, features = ["std"] }
|
||||
log = { version = "0.4", default-features = false, features = ["std"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dkg"
|
|||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
keywords = ["dkg", "multisig", "threshold", "ff", "group"]
|
||||
edition = "2021"
|
||||
rust-version = "1.80"
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -17,7 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"]
|
|||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
thiserror = { version = "1", default-features = false, optional = true }
|
||||
thiserror = { version = "2", default-features = false }
|
||||
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
|
||||
|
@ -58,7 +58,7 @@ pasta_curves = "0.5"
|
|||
|
||||
[features]
|
||||
std = [
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"rand_core/std",
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
use core::fmt::{self, Debug};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use thiserror::Error;
|
||||
|
||||
use zeroize::Zeroize;
|
||||
|
@ -67,8 +66,7 @@ impl fmt::Display for Participant {
|
|||
}
|
||||
|
||||
/// Various errors possible during key generation.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(Error))]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Error)]
|
||||
pub enum DkgError<B: Clone + PartialEq + Eq + Debug> {
|
||||
/// A parameter was zero.
|
||||
#[cfg_attr(feature = "std", error("a parameter was 0 (threshold {0}, participants {1})"))]
|
||||
|
|
|
@ -6,7 +6,7 @@ license = "MIT"
|
|||
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dleq"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.79"
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -18,7 +18,7 @@ workspace = true
|
|||
[dependencies]
|
||||
rustversion = "1"
|
||||
|
||||
thiserror = { version = "1", optional = true }
|
||||
thiserror = { version = "2", default-features = false, optional = true }
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
||||
|
@ -44,7 +44,7 @@ dalek-ff-group = { path = "../dalek-ff-group" }
|
|||
transcript = { package = "flexible-transcript", path = "../transcript", features = ["recommended"] }
|
||||
|
||||
[features]
|
||||
std = ["rand_core/std", "zeroize/std", "digest/std", "transcript/std", "ff/std", "multiexp?/std"]
|
||||
std = ["thiserror?/std", "rand_core/std", "zeroize/std", "digest/std", "transcript/std", "ff/std", "multiexp?/std"]
|
||||
serialize = ["std"]
|
||||
|
||||
# Needed for cross-group DLEqs
|
||||
|
|
|
@ -92,7 +92,7 @@ impl<G: PrimeGroup> Generators<G> {
|
|||
}
|
||||
|
||||
/// Error for cross-group DLEq proofs.
|
||||
#[derive(Error, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Error)]
|
||||
pub enum DLEqError {
|
||||
/// Invalid proof length.
|
||||
#[error("invalid proof length")]
|
||||
|
|
|
@ -22,7 +22,7 @@ rand_core = { version = "0.6", default-features = false, features = ["std"] }
|
|||
zeroize = { version = "^1.5", default-features = false, features = ["std", "zeroize_derive"] }
|
||||
subtle = { version = "^2.4", default-features = false, features = ["std"] }
|
||||
|
||||
generic-array = { version = "0.14", default-features = false }
|
||||
generic-array = { version = "1", default-features = false }
|
||||
crypto-bigint = { version = "0.5", default-features = false, features = ["zeroize"] }
|
||||
|
||||
dalek-ff-group = { path = "../../dalek-ff-group", version = "0.4", default-features = false }
|
||||
|
|
|
@ -17,7 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"]
|
|||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1"
|
||||
thiserror = { version = "2", default-features = false, features = ["std"] }
|
||||
|
||||
rand_core = { version = "0.6", default-features = false, features = ["std"] }
|
||||
rand_chacha = { version = "0.3", default-features = false, features = ["std"] }
|
||||
|
|
|
@ -18,7 +18,7 @@ workspace = true
|
|||
[dependencies]
|
||||
std-shims = { version = "0.1.1", path = "../../common/std-shims", default-features = false }
|
||||
|
||||
thiserror = { version = "1", default-features = false, optional = true }
|
||||
thiserror = { version = "2", default-features = false }
|
||||
|
||||
zeroize = { version = "^1.5", default-features = false }
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
|
@ -44,7 +44,7 @@ tokio = { version = "1", features = ["macros"] }
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
"rand_core/std",
|
||||
|
|
|
@ -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 }
|
||||
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
||||
|
@ -42,7 +42,7 @@ hex-literal = "0.4"
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"rand_core/std",
|
||||
"zeroize/std",
|
||||
|
|
|
@ -45,14 +45,13 @@ use crate::plus::{
|
|||
mod tests;
|
||||
|
||||
/// An error from proving/verifying Bulletproofs(+).
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum BulletproofError {
|
||||
/// Proving/verifying a Bulletproof(+) range proof with no commitments.
|
||||
#[cfg_attr(feature = "std", error("no commitments to prove the range for"))]
|
||||
#[error("no commitments to prove the range for")]
|
||||
NoCommitments,
|
||||
/// Proving/verifying a Bulletproof(+) range proof with more commitments than supported.
|
||||
#[cfg_attr(feature = "std", error("too many commitments to prove the range for"))]
|
||||
#[error("too many commitments to prove the range for")]
|
||||
TooManyCommitments,
|
||||
}
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
||||
|
@ -46,7 +46,7 @@ frost = { package = "modular-frost", path = "../../../../crypto/frost", default-
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"rand_core/std",
|
||||
"zeroize/std",
|
||||
|
|
|
@ -36,29 +36,28 @@ pub use multisig::{ClsagMultisigMaskSender, ClsagAddendum, ClsagMultisig};
|
|||
mod tests;
|
||||
|
||||
/// Errors when working with CLSAGs.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum ClsagError {
|
||||
/// The ring was invalid (such as being too small or too large).
|
||||
#[cfg_attr(feature = "std", error("invalid ring"))]
|
||||
#[error("invalid ring")]
|
||||
InvalidRing,
|
||||
/// The discrete logarithm of the key, scaling G, wasn't equivalent to the signing ring member.
|
||||
#[cfg_attr(feature = "std", error("invalid commitment"))]
|
||||
#[error("invalid commitment")]
|
||||
InvalidKey,
|
||||
/// The commitment opening provided did not match the ring member's.
|
||||
#[cfg_attr(feature = "std", error("invalid commitment"))]
|
||||
#[error("invalid commitment")]
|
||||
InvalidCommitment,
|
||||
/// The key image was invalid (such as being identity or torsioned)
|
||||
#[cfg_attr(feature = "std", error("invalid key image"))]
|
||||
#[error("invalid key image")]
|
||||
InvalidImage,
|
||||
/// The `D` component was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid D"))]
|
||||
#[error("invalid D")]
|
||||
InvalidD,
|
||||
/// The `s` vector was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid s"))]
|
||||
#[error("invalid s")]
|
||||
InvalidS,
|
||||
/// The `c1` variable was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid c1"))]
|
||||
#[error("invalid c1")]
|
||||
InvalidC1,
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
|
||||
|
@ -34,7 +34,7 @@ monero-primitives = { path = "../../primitives", version = "0.1", default-featur
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
|
||||
|
|
|
@ -19,23 +19,22 @@ use monero_generators::{H, hash_to_point};
|
|||
use monero_primitives::keccak256_to_scalar;
|
||||
|
||||
/// Errors when working with MLSAGs.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum MlsagError {
|
||||
/// Invalid ring (such as too small or too large).
|
||||
#[cfg_attr(feature = "std", error("invalid ring"))]
|
||||
#[error("invalid ring")]
|
||||
InvalidRing,
|
||||
/// Invalid amount of key images.
|
||||
#[cfg_attr(feature = "std", error("invalid amount of key images"))]
|
||||
#[error("invalid amount of key images")]
|
||||
InvalidAmountOfKeyImages,
|
||||
/// Invalid ss matrix.
|
||||
#[cfg_attr(feature = "std", error("invalid ss"))]
|
||||
#[error("invalid ss")]
|
||||
InvalidSs,
|
||||
/// Invalid key image.
|
||||
#[cfg_attr(feature = "std", error("invalid key image"))]
|
||||
#[error("invalid key image")]
|
||||
InvalidKeyImage,
|
||||
/// Invalid ci vector.
|
||||
#[cfg_attr(feature = "std", error("invalid ci"))]
|
||||
#[error("invalid ci")]
|
||||
InvalidCi,
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
hex = { version = "0.4", default-features = false, features = ["alloc"] }
|
||||
|
@ -34,7 +34,7 @@ monero-address = { path = "../wallet/address", default-features = false }
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
"hex/std",
|
||||
|
|
|
@ -42,34 +42,33 @@ const GRACE_BLOCKS_FOR_FEE_ESTIMATE: u64 = 10;
|
|||
const TXS_PER_REQUEST: usize = 100;
|
||||
|
||||
/// An error from the RPC.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum RpcError {
|
||||
/// An internal error.
|
||||
#[cfg_attr(feature = "std", error("internal error ({0})"))]
|
||||
#[error("internal error ({0})")]
|
||||
InternalError(String),
|
||||
/// A connection error with the node.
|
||||
#[cfg_attr(feature = "std", error("connection error ({0})"))]
|
||||
#[error("connection error ({0})")]
|
||||
ConnectionError(String),
|
||||
/// The node is invalid per the expected protocol.
|
||||
#[cfg_attr(feature = "std", error("invalid node ({0})"))]
|
||||
#[error("invalid node ({0})")]
|
||||
InvalidNode(String),
|
||||
/// Requested transactions weren't found.
|
||||
#[cfg_attr(feature = "std", error("transactions not found"))]
|
||||
#[error("transactions not found")]
|
||||
TransactionsNotFound(Vec<[u8; 32]>),
|
||||
/// The transaction was pruned.
|
||||
///
|
||||
/// Pruned transactions are not supported at this time.
|
||||
#[cfg_attr(feature = "std", error("pruned transaction"))]
|
||||
#[error("pruned transaction")]
|
||||
PrunedTransaction,
|
||||
/// A transaction (sent or received) was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid transaction ({0:?})"))]
|
||||
#[error("invalid transaction ({0:?})")]
|
||||
InvalidTransaction([u8; 32]),
|
||||
/// The returned fee was unusable.
|
||||
#[cfg_attr(feature = "std", error("unexpected fee response"))]
|
||||
#[error("unexpected fee response")]
|
||||
InvalidFee,
|
||||
/// The priority intended for use wasn't usable.
|
||||
#[cfg_attr(feature = "std", error("invalid priority"))]
|
||||
#[error("invalid priority")]
|
||||
InvalidPriority,
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,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"] }
|
||||
|
||||
|
@ -61,7 +61,7 @@ monero-simple-request-rpc = { path = "../rpc/simple-request", default-features =
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 }
|
||||
|
||||
subtle = { version = "^2.4", default-features = false }
|
||||
zeroize = { version = "^1.5", default-features = false, features = ["zeroize_derive"] }
|
||||
|
@ -34,7 +34,7 @@ hex = { version = "0.4", default-features = false, features = ["std"] }
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"subtle/std",
|
||||
"zeroize/std",
|
||||
|
|
|
@ -106,20 +106,19 @@ const POLYSEED_KEYGEN_ITERATIONS: u32 = 10000;
|
|||
const COIN: u16 = 0;
|
||||
|
||||
/// An error when working with a Polyseed.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum PolyseedError {
|
||||
/// The seed was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid seed"))]
|
||||
#[error("invalid seed")]
|
||||
InvalidSeed,
|
||||
/// The entropy was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid entropy"))]
|
||||
#[error("invalid entropy")]
|
||||
InvalidEntropy,
|
||||
/// The checksum did not match the data.
|
||||
#[cfg_attr(feature = "std", error("invalid checksum"))]
|
||||
#[error("invalid checksum")]
|
||||
InvalidChecksum,
|
||||
/// Unsupported feature bits were set.
|
||||
#[cfg_attr(feature = "std", error("unsupported features"))]
|
||||
#[error("unsupported features")]
|
||||
UnsupportedFeatures,
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
|
@ -33,7 +33,7 @@ monero-primitives = { path = "../../primitives", default-features = false, featu
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
"rand_core/std",
|
||||
|
|
|
@ -26,19 +26,18 @@ const SEED_LENGTH: usize = 24;
|
|||
const SEED_LENGTH_WITH_CHECKSUM: usize = 25;
|
||||
|
||||
/// An error when working with a seed.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum SeedError {
|
||||
#[cfg_attr(feature = "std", error("invalid seed"))]
|
||||
#[error("invalid seed")]
|
||||
/// The seed was invalid.
|
||||
InvalidSeed,
|
||||
/// The checksum did not match the data.
|
||||
#[cfg_attr(feature = "std", error("invalid checksum"))]
|
||||
#[error("invalid checksum")]
|
||||
InvalidChecksum,
|
||||
/// The deprecated English language option was used with a checksum.
|
||||
///
|
||||
/// The deprecated English language option did not include a checksum.
|
||||
#[cfg_attr(feature = "std", error("deprecated English language option included a checksum"))]
|
||||
#[error("deprecated English language option included a checksum")]
|
||||
DeprecatedEnglishWithChecksum,
|
||||
}
|
||||
|
||||
|
|
|
@ -67,14 +67,13 @@ impl Timelocked {
|
|||
}
|
||||
|
||||
/// Errors when scanning a block.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum ScanError {
|
||||
/// The block was for an unsupported protocol version.
|
||||
#[cfg_attr(feature = "std", error("unsupported protocol version ({0})"))]
|
||||
#[error("unsupported protocol version ({0})")]
|
||||
UnsupportedProtocol(u8),
|
||||
/// The ScannableBlock was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid scannable block ({0})"))]
|
||||
#[error("invalid scannable block ({0})")]
|
||||
InvalidScannableBlock(&'static str),
|
||||
}
|
||||
|
||||
|
|
|
@ -140,48 +140,44 @@ impl InternalPayment {
|
|||
}
|
||||
|
||||
/// An error while sending Monero.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum SendError {
|
||||
/// The RingCT type to produce proofs for this transaction with weren't supported.
|
||||
#[cfg_attr(feature = "std", error("this library doesn't yet support that RctType"))]
|
||||
#[error("this library doesn't yet support that RctType")]
|
||||
UnsupportedRctType,
|
||||
/// The transaction had no inputs specified.
|
||||
#[cfg_attr(feature = "std", error("no inputs"))]
|
||||
#[error("no inputs")]
|
||||
NoInputs,
|
||||
/// The decoy quantity was invalid for the specified RingCT type.
|
||||
#[cfg_attr(feature = "std", error("invalid number of decoys"))]
|
||||
#[error("invalid number of decoys")]
|
||||
InvalidDecoyQuantity,
|
||||
/// The transaction had no outputs specified.
|
||||
#[cfg_attr(feature = "std", error("no outputs"))]
|
||||
#[error("no outputs")]
|
||||
NoOutputs,
|
||||
/// The transaction had too many outputs specified.
|
||||
#[cfg_attr(feature = "std", error("too many outputs"))]
|
||||
#[error("too many outputs")]
|
||||
TooManyOutputs,
|
||||
/// The transaction did not have a change output, and did not have two outputs.
|
||||
///
|
||||
/// Monero requires all transactions have at least two outputs, assuming one payment and one
|
||||
/// change (or at least one dummy and one change). Accordingly, specifying no change and only
|
||||
/// one payment prevents creating a valid transaction
|
||||
#[cfg_attr(feature = "std", error("only one output and no change address"))]
|
||||
#[error("only one output and no change address")]
|
||||
NoChange,
|
||||
/// Multiple addresses had payment IDs specified.
|
||||
///
|
||||
///o
|
||||
/// Only one payment ID is allowed per transaction.
|
||||
#[cfg_attr(feature = "std", error("multiple addresses with payment IDs"))]
|
||||
#[error("multiple addresses with payment IDs")]
|
||||
MultiplePaymentIds,
|
||||
/// Too much arbitrary data was specified.
|
||||
#[cfg_attr(feature = "std", error("too much data"))]
|
||||
#[error("too much data")]
|
||||
TooMuchArbitraryData,
|
||||
/// The created transaction was too large.
|
||||
#[cfg_attr(feature = "std", error("too large of a transaction"))]
|
||||
#[error("too large of a transaction")]
|
||||
TooLargeTransaction,
|
||||
/// This transaction could not pay for itself.
|
||||
#[cfg_attr(
|
||||
feature = "std",
|
||||
error(
|
||||
"not enough funds (inputs {inputs}, outputs {outputs}, necessary_fee {necessary_fee:?})"
|
||||
)
|
||||
#[error(
|
||||
"not enough funds (inputs {inputs}, outputs {outputs}, necessary_fee {necessary_fee:?})"
|
||||
)]
|
||||
NotEnoughFunds {
|
||||
/// The amount of funds the inputs contributed.
|
||||
|
@ -195,20 +191,17 @@ pub enum SendError {
|
|||
necessary_fee: Option<u64>,
|
||||
},
|
||||
/// This transaction is being signed with the wrong private key.
|
||||
#[cfg_attr(feature = "std", error("wrong spend private key"))]
|
||||
#[error("wrong spend private key")]
|
||||
WrongPrivateKey,
|
||||
/// This transaction was read from a bytestream which was malicious.
|
||||
#[cfg_attr(
|
||||
feature = "std",
|
||||
error("this SignableTransaction was created by deserializing a malicious serialization")
|
||||
)]
|
||||
#[error("this SignableTransaction was created by deserializing a malicious serialization")]
|
||||
MaliciousSerialization,
|
||||
/// There was an error when working with the CLSAGs.
|
||||
#[cfg_attr(feature = "std", error("clsag error ({0})"))]
|
||||
#[error("clsag error ({0})")]
|
||||
ClsagError(ClsagError),
|
||||
/// There was an error when working with FROST.
|
||||
#[cfg(feature = "multisig")]
|
||||
#[cfg_attr(feature = "std", error("frost error {0}"))]
|
||||
#[error("frost error {0}")]
|
||||
FrostError(FrostError),
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ use crate::{
|
|||
};
|
||||
|
||||
/// An error while working with a ViewPair.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum ViewPairError {
|
||||
/// The spend key was torsioned.
|
||||
///
|
||||
|
@ -20,7 +19,7 @@ pub enum ViewPairError {
|
|||
// CLSAG seems to support it if the challenge does a torsion clear, FCMP++ should ship with a
|
||||
// torsion clear, yet it's not worth it to modify CLSAG sign to generate challenges until the
|
||||
// torsion clears and ensure spendability (nor can we reasonably guarantee that in the future)
|
||||
#[cfg_attr(feature = "std", error("torsioned spend key"))]
|
||||
#[error("torsioned spend key")]
|
||||
TorsionedSpendKey,
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
rand_core = { version = "0.6", default-features = false }
|
||||
|
@ -36,7 +36,7 @@ curve25519-dalek = { version = "4", default-features = false, features = ["alloc
|
|||
std = [
|
||||
"std-shims/std",
|
||||
|
||||
"thiserror",
|
||||
"thiserror/std",
|
||||
|
||||
"zeroize/std",
|
||||
"rand_core/std",
|
||||
|
|
|
@ -11,20 +11,19 @@ use original::{SeedError as OriginalSeedError, Seed as OriginalSeed};
|
|||
use polyseed::{PolyseedError, Polyseed};
|
||||
|
||||
/// An error from working with seeds.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "std", derive(thiserror::Error))]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, thiserror::Error)]
|
||||
pub enum SeedError {
|
||||
/// The seed was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid seed"))]
|
||||
#[error("invalid seed")]
|
||||
InvalidSeed,
|
||||
/// The entropy was invalid.
|
||||
#[cfg_attr(feature = "std", error("invalid entropy"))]
|
||||
#[error("invalid entropy")]
|
||||
InvalidEntropy,
|
||||
/// The checksum did not match the data.
|
||||
#[cfg_attr(feature = "std", error("invalid checksum"))]
|
||||
#[error("invalid checksum")]
|
||||
InvalidChecksum,
|
||||
/// Unsupported features were enabled.
|
||||
#[cfg_attr(feature = "std", error("unsupported features"))]
|
||||
#[error("unsupported features")]
|
||||
UnsupportedFeatures,
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ workspace = true
|
|||
|
||||
[dependencies]
|
||||
zeroize = "^1.5"
|
||||
thiserror = { version = "1", optional = true }
|
||||
thiserror = { version = "2", default-features = false, optional = true }
|
||||
|
||||
bitvec = { version = "1", default-features = false, features = ["alloc", "serde"] }
|
||||
|
||||
|
@ -60,7 +60,7 @@ dockertest = "0.5"
|
|||
serai-docker-tests = { path = "../../tests/docker" }
|
||||
|
||||
[features]
|
||||
serai = ["thiserror", "serde", "serde_json", "serai-abi/serde", "multiaddr", "sp-core", "sp-runtime", "frame-system", "simple-request"]
|
||||
serai = ["thiserror/std", "serde", "serde_json", "serai-abi/serde", "multiaddr", "sp-core", "sp-runtime", "frame-system", "simple-request"]
|
||||
borsh = ["serai-abi/borsh"]
|
||||
|
||||
networks = []
|
||||
|
|
|
@ -55,7 +55,7 @@ impl Block {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum SeraiError {
|
||||
#[error("failed to communicate with serai")]
|
||||
ConnectionError,
|
||||
|
|
|
@ -19,7 +19,7 @@ ignored = ["scale", "scale-info"]
|
|||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] }
|
||||
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher", "inline-more"] }
|
||||
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2", default-features = false, features = ["derive"] }
|
||||
|
|
Loading…
Reference in a new issue