fn internal_sig_shares_by_index_from_sig_shares(
    shares: &BTreeMap<NodeId, ThresholdEcdsaSigShare>,
    receivers: &IDkgReceivers,
) -> Result<BTreeMap<NodeIndex, ThresholdEcdsaSigShareInternal>, ThresholdEcdsaCombineSigSharesError>
{
    shares
        .iter()
        .map(|(&id, share)| {
            let index = receivers
                .position(id)
                .ok_or(ThresholdEcdsaCombineSigSharesError::SignerNotAllowed { node_id: id })?;
            let internal_share = ThresholdEcdsaSigShareInternal::deserialize(&share.sig_share_raw)
                .map_err(
                    |e| ThresholdEcdsaCombineSigSharesError::SerializationError {
                        internal_error: format!("{:?}", e),
                    },
                )?;
            Ok((index, internal_share))
        })
        .collect()
}
/// Deserialize each raw signature share to the internal format,
/// and map them by signer index (rather than signer Id).
Deserialize each raw signature share to the internal format,
and map them by signer index (rather than signer Id).
Deserialize each raw signature share to the internal format and map them by signer index ( rather than signer Id ) .
fn internal_sig_shares_by_index_from_sig_shares(
    shares: &BTreeMap<NodeId, ThresholdEcdsaSigShare>,
    receivers: &IDkgReceivers,
) -> Result<BTreeMap<NodeIndex, ThresholdEcdsaSigShareInternal>, ThresholdEcdsaCombineSigSharesError>
{
    shares
        .iter()
        .map(|(&id, share)| {
            let index = receivers
                .position(id)
                .ok_or(ThresholdEcdsaCombineSigSharesError::SignerNotAllowed { node_id: id })?;
            let internal_share = ThresholdEcdsaSigShareInternal::deserialize(&share.sig_share_raw)
                .map_err(
                    |e| ThresholdEcdsaCombineSigSharesError::SerializationError {
                        internal_error: format!("{:?}", e),
                    },
                )?;
            Ok((index, internal_share))
        })
        .collect()
}
fn internal_sig_shares_by_index_from_sig_shares ( shares : & BTreeMap < NodeId , ThresholdEcdsaSigShare > , receivers : & IDkgReceivers , ) -> Result < BTreeMap < NodeIndex , ThresholdEcdsaSigShareInternal > , ThresholdEcdsaCombineSigSharesError > { shares . iter ( ) . map ( | ( & id , share ) | { let index = receivers . position ( id ) . ok_or ( ThresholdEcdsaCombineSigSharesError :: SignerNotAllowed { node_id : id } ) ? ; let internal_share = ThresholdEcdsaSigShareInternal :: deserialize ( & share . sig_share_raw ) . map_err ( | e | ThresholdEcdsaCombineSigSharesError :: SerializationError { internal_error : format ! ( " " e ) , } , ) ? ; Ok ( ( index , internal_share ) ) } ) . collect ( ) }
Deserialize each raw signature share to the internal format,
and map them by signer index (rather than signer Id).
Deserialize each raw signature share to the internal format and map them by signer index ( rather than signer Id ) .
shares
&BTreeMap<NodeId, ThresholdEcdsaSigShare>
receivers
&IDkgReceivers
shares
&BTreeMap<NodeId, ThresholdEcdsaSigShare>
receivers
&IDkgReceivers