1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//! Multi-signature error.

use ckb_error::{def_error_base_on_kind, prelude::*};

/// Multi-signature error kinds.
#[derive(Error, Copy, Clone, Eq, PartialEq, Debug)]
pub enum ErrorKind {
    /// The count of signatures should be less than the count of private keys.
    #[error("The count of sigs should be less than privkeys.")]
    SigCountOverflow,
    /// The count of signatures is less than the threshold.
    #[error("The count of sigs is less than threshold.")]
    SigNotEnough,
    /// The verified signatures count is less than the threshold.
    #[error("Failed to meet threshold {threshold}, actual: {pass_sigs}.")]
    Threshold {
        /// The required count of valid signatures.
        threshold: usize,
        /// The actual count of valid signatures.
        pass_sigs: usize,
    },
}

def_error_base_on_kind!(Error, ErrorKind, "Multi-signature error.");