fn create_next_ecdsa_transcript_config(
    subnet_nodes: &[NodeId],
    summary_registry_version: RegistryVersion,
    ecdsa_transcript: &Option<ecdsa::UnmaskedTranscript>,
    next_unused_transcript_id: &mut IDkgTranscriptId,
) -> Result<Option<ecdsa::ReshareOfUnmaskedParams>, EcdsaPayloadError> {
    if let Some(transcript) = ecdsa_transcript {
        let transcript_id = *next_unused_transcript_id;
        *next_unused_transcript_id = transcript_id.increment();
        let dealers = IDkgDealers::new(subnet_nodes.iter().copied().collect::<BTreeSet<_>>())?;
        let receivers = IDkgReceivers::new(subnet_nodes.iter().copied().collect::<BTreeSet<_>>())?;
        Ok(Some(ecdsa::RandomTranscriptParams::new(
            transcript_id,
            dealers,
            receivers,
            summary_registry_version,
            AlgorithmId::ThresholdEcdsaSecp256k1,
            IDkgTranscriptOperation::ReshareOfUnmasked(transcript.clone().into()),
        )?))
    } else {
        Ok(None)
    }
}
/// Create a resharing config for the next ecdsa transcript.
Create a resharing config for the next ecdsa transcript.
Create a resharing config for the next ecdsa transcript .
fn create_next_ecdsa_transcript_config(
    subnet_nodes: &[NodeId],
    summary_registry_version: RegistryVersion,
    ecdsa_transcript: &Option<ecdsa::UnmaskedTranscript>,
    next_unused_transcript_id: &mut IDkgTranscriptId,
) -> Result<Option<ecdsa::ReshareOfUnmaskedParams>, EcdsaPayloadError> {
    if let Some(transcript) = ecdsa_transcript {
        let transcript_id = *next_unused_transcript_id;
        *next_unused_transcript_id = transcript_id.increment();
        let dealers = IDkgDealers::new(subnet_nodes.iter().copied().collect::<BTreeSet<_>>())?;
        let receivers = IDkgReceivers::new(subnet_nodes.iter().copied().collect::<BTreeSet<_>>())?;
        Ok(Some(ecdsa::RandomTranscriptParams::new(
            transcript_id,
            dealers,
            receivers,
            summary_registry_version,
            AlgorithmId::ThresholdEcdsaSecp256k1,
            IDkgTranscriptOperation::ReshareOfUnmasked(transcript.clone().into()),
        )?))
    } else {
        Ok(None)
    }
}
fn create_next_ecdsa_transcript_config ( subnet_nodes : & [ NodeId ] , summary_registry_version : RegistryVersion , ecdsa_transcript : & Option < ecdsa :: UnmaskedTranscript > , next_unused_transcript_id : & mut IDkgTranscriptId , ) -> Result < Option < ecdsa :: ReshareOfUnmaskedParams > , EcdsaPayloadError > { if let Some ( transcript ) = ecdsa_transcript { let transcript_id = * next_unused_transcript_id ; * next_unused_transcript_id = transcript_id . increment ( ) ; let dealers = IDkgDealers :: new ( subnet_nodes . iter ( ) . copied ( ) . collect :: < BTreeSet < _ > > ( ) ) ? ; let receivers = IDkgReceivers :: new ( subnet_nodes . iter ( ) . copied ( ) . collect :: < BTreeSet < _ > > ( ) ) ? ; Ok ( Some ( ecdsa :: RandomTranscriptParams :: new ( transcript_id , dealers , receivers , summary_registry_version , AlgorithmId :: ThresholdEcdsaSecp256k1 , IDkgTranscriptOperation :: ReshareOfUnmasked ( transcript . clone ( ) . into ( ) ) , ) ? ) ) } else { Ok ( None ) } }
Create a resharing config for the next ecdsa transcript.
Create a resharing config for the next ecdsa transcript .
subnet_nodes
&[NodeId]
summary_registry_version
RegistryVersion
ecdsa_transcript
&Option<ecdsa::UnmaskedTranscript>
next_unused_transcript_id
&mut IDkgTranscriptId
subnet_nodes
&[NodeId]
summary_registry_version
RegistryVersion
ecdsa_transcript
&Option<ecdsa::UnmaskedTranscript>
next_unused_transcript_id
&mut IDkgTranscriptId