fedimint_threshold_crypto/
error.rs1use thiserror::Error;
4
5#[derive(Clone, Eq, PartialEq, Debug, Error)]
7pub enum Error {
8 #[error("Not enough signature shares")]
10 NotEnoughShares,
11 #[error("Signature shares contain a duplicated index")]
13 DuplicateEntry,
14 #[error("The degree is too high for the coefficients to be indexed by usize.")]
16 DegreeTooHigh,
17}
18
19pub type Result<T> = ::std::result::Result<T, Error>;
21
22#[cfg(test)]
23mod tests {
24 use super::Error;
25
26 fn is_send_and_sync<T: Send + Sync>(_: T) {}
28
29 #[test]
30 fn errors_are_send_and_sync() {
31 is_send_and_sync(Error::NotEnoughShares);
32 }
33}
34
35#[derive(Clone, Eq, PartialEq, Debug, Error)]
37pub enum ScalaromBytesError {
38 #[error("Invalid representation.")]
40 Invalid,
41}
42
43pub type ScalaromBytesResult<T> = ::std::result::Result<T, ScalaromBytesError>;