fn map_threshold_sign_error_or_panic(
    error: CspThresholdSignError,
    dkg_id: DkgId,
) -> ThresholdSignError {
    match error {
        CspThresholdSignError::SecretKeyNotFound { algorithm, key_id } => {
            // If the secret key was not found, reloading the transcript will not help
            // because we are sure at this point that the transcript was already
            // successfully loaded. Thus, we don't return a ThresholdSigDataNotFound error
            // here.
            ThresholdSignError::SecretKeyNotFound {
                dkg_id,
                algorithm,
                key_id,
            }
        }
        // Panic, since these would be implementation errors:
        CspThresholdSignError::UnsupportedAlgorithm { .. }
        | CspThresholdSignError::MalformedSecretKey { .. }
        | CspThresholdSignError::WrongSecretKeyType { .. }
        | CspThresholdSignError::InternalError { .. } => panic!("Illegal state: {}", error),
    }
}
// Normally we implement a `From` conversion. But since this conversion takes
// the dkg_id as parameter, this cannot be done in this case.
Normally we implement a `From` conversion. But since this conversion takes
the dkg_id as parameter, this cannot be done in this case.
Normally we implement a ` From ` conversion . But since this conversion takes the dkg_id as parameter this cannot be done in this case .
fn map_threshold_sign_error_or_panic(
    error: CspThresholdSignError,
    dkg_id: DkgId,
) -> ThresholdSignError {
    match error {
        CspThresholdSignError::SecretKeyNotFound { algorithm, key_id } => {
            // If the secret key was not found, reloading the transcript will not help
            // because we are sure at this point that the transcript was already
            // successfully loaded. Thus, we don't return a ThresholdSigDataNotFound error
            // here.
            ThresholdSignError::SecretKeyNotFound {
                dkg_id,
                algorithm,
                key_id,
            }
        }
        // Panic, since these would be implementation errors:
        CspThresholdSignError::UnsupportedAlgorithm { .. }
        | CspThresholdSignError::MalformedSecretKey { .. }
        | CspThresholdSignError::WrongSecretKeyType { .. }
        | CspThresholdSignError::InternalError { .. } => panic!("Illegal state: {}", error),
    }
}
fn map_threshold_sign_error_or_panic ( error : CspThresholdSignError , dkg_id : DkgId , ) -> ThresholdSignError { match error { CspThresholdSignError :: SecretKeyNotFound { algorithm , key_id } => { // If the secret key was not found, reloading the transcript will not help // because we are sure at this point that the transcript was already // successfully loaded. Thus, we don't return a ThresholdSigDataNotFound error // here. ThresholdSignError :: SecretKeyNotFound { dkg_id , algorithm , key_id , } } // Panic, since these would be implementation errors: CspThresholdSignError :: UnsupportedAlgorithm { .. } | CspThresholdSignError :: MalformedSecretKey { .. } | CspThresholdSignError :: WrongSecretKeyType { .. } | CspThresholdSignError :: InternalError { .. } => panic ! ( " " error ) , } }
Normally we implement a `From` conversion.
Normally we implement a ` From ` conversion .
error
CspThresholdSignError
dkg_id
DkgId
error
CspThresholdSignError
dkg_id
DkgId