/// Verifies that threshold signatures can be used correctly and that common
/// misuses fail.
///
/// Note: This calls the standard threshold signature test on a test fixture.
/// The standard test verifies that the happy path succeeds and that deviations
/// from the happy path, such as providing an incorrect signature, result in an
/// error.
Verifies that threshold signatures can be used correctly and that common
misuses fail.

This calls the standard threshold signature test on a test fixture.
The standard test verifies that the happy path succeeds and that deviations
from the happy path, such as providing an incorrect signature, result in an
error.
Verifies that threshold signatures can be used correctly and that common misuses fail . This calls the standard threshold signature test on a test fixture . The standard test verifies that the happy path succeeds and that deviations from the happy path such as providing an incorrect signature result in an error .
fn threshold_signatures_should_work(
    network: &MockNetwork,
    config: &MockDkgConfig,
    transcript: &internal_types::CspNiDkgTranscript,
    rng: &mut ChaCha20Rng,
) {
    let internal_types::CspNiDkgTranscript::Groth20_Bls12_381(transcript) = transcript;
    let public_coefficients = PublicCoefficientsBytes {
        coefficients: transcript.public_coefficients.coefficients.clone(),
    };
    let public_coefficients = csp_types::CspPublicCoefficients::Bls12_381(public_coefficients);
    let signatories: Vec<(&Csp<_, _, _>, KeyId)> = {
        let key_id = key_id_from_csp_pub_coeffs(&public_coefficients);
        config
            .receivers
            .get()
            .iter()
            .map(|node_id| {
                let node = network
                    .nodes_by_node_id
                    .get(node_id)
                    .expect("Test error - could not find node listed in configuration");
                let csp = &node.csp;
                (csp, key_id)
            })
            .collect()
    };
    let seed = Randomness::from(rng.gen::<[u8; 32]>());
    let message = b"Tinker tailor soldier spy";
    test_threshold_signatures(&public_coefficients, &signatories[..], seed, &message[..]);
}
fn threshold_signatures_should_work ( network : & MockNetwork , config : & MockDkgConfig , transcript : & internal_types :: CspNiDkgTranscript , rng : & mut ChaCha20Rng , ) { let internal_types :: CspNiDkgTranscript :: Groth20_Bls12_381 ( transcript ) = transcript ; let public_coefficients = PublicCoefficientsBytes { coefficients : transcript . public_coefficients . coefficients . clone ( ) , } ; let public_coefficients = csp_types :: CspPublicCoefficients :: Bls12_381 ( public_coefficients ) ; let signatories : Vec < ( & Csp < _ , _ , _ > , KeyId ) > = { let key_id = key_id_from_csp_pub_coeffs ( & public_coefficients ) ; config . receivers . get ( ) . iter ( ) . map ( | node_id | { let node = network . nodes_by_node_id . get ( node_id ) . expect ( " " ) ; let csp = & node . csp ; ( csp , key_id ) } ) . collect ( ) } ; let seed = Randomness :: from ( rng . gen :: < [ u8 ; 32 ] > ( ) ) ; let message = b" " ; test_threshold_signatures ( & public_coefficients , & signatories [ .. ] , seed , & message [ .. ] ) ; }
Verifies that threshold signatures can be used correctly and that common
misuses fail.
Verifies that threshold signatures can be used correctly and that common misuses fail .
network
&MockNetwork
config
&MockDkgConfig
transcript
&internal_types::CspNiDkgTranscript
rng
&mut ChaCha20Rng