ckb_multisig/
error.rs

1//! Multi-signature error.
2
3use ckb_error::{def_error_base_on_kind, prelude::*};
4
5/// Multi-signature error kinds.
6#[derive(Error, Copy, Clone, Eq, PartialEq, Debug)]
7pub enum ErrorKind {
8    /// The count of signatures should be less than the count of private keys.
9    #[error("The count of sigs should be less than privkeys.")]
10    SigCountOverflow,
11    /// The count of signatures is less than the threshold.
12    #[error("The count of sigs is less than threshold.")]
13    SigNotEnough,
14    /// The verified signatures count is less than the threshold.
15    #[error("Failed to meet threshold {threshold}, actual: {pass_sigs}.")]
16    Threshold {
17        /// The required count of valid signatures.
18        threshold: usize,
19        /// The actual count of valid signatures.
20        pass_sigs: usize,
21    },
22}
23
24def_error_base_on_kind!(Error, ErrorKind, "Multi-signature error.");