pub fn reveal_seals<'a>(
        &mut self,
        known_seals: impl Iterator<Item = &'a OutpointReveal>,
    ) -> usize {
        let known_seals: HashMap<seal::Confidential, OutpointReveal> =
            known_seals
                .map(|rev| (rev.commit_conceal(), rev.clone()))
                .collect();

        let mut counter = 0;
        match self {
            Assignment::Confidential {
                seal_definition,
                assigned_state,
            } => {
                if let Some(reveal) = known_seals.get(seal_definition) {
                    *self = Assignment::ConfidentialAmount {
                        seal_definition: seal::Revealed::TxOutpoint(
                            reveal.clone(),
                        ),
                        assigned_state: assigned_state.clone(),
                    };
                    counter += 1;
                };
            }
            Assignment::ConfidentialSeal {
                seal_definition,
                assigned_state,
            } => {
                if let Some(reveal) = known_seals.get(seal_definition) {
                    *self = Assignment::Revealed {
                        seal_definition: seal::Revealed::TxOutpoint(
                            reveal.clone(),
                        ),
                        assigned_state: assigned_state.clone(),
                    };
                    counter += 1;
                };
            }
            _ => {}
        }
        counter
    }
/// Reveals previously known seal information (replacing blind UTXOs with
/// unblind ones). Function is used when a peer receives consignment
/// containing concealed seals for the outputs owned by the peer
Reveals previously known seal information (replacing blind UTXOs with
unblind ones). Function is used when a peer receives consignment
containing concealed seals for the outputs owned by the peer
Reveals previously known seal information ( replacing blind UTXOs with unblind ones ) . Function is used when a peer receives consignment containing concealed seals for the outputs owned by the peer
pub fn reveal_seals<'a>(
        &mut self,
        known_seals: impl Iterator<Item = &'a OutpointReveal>,
    ) -> usize {
        let known_seals: HashMap<seal::Confidential, OutpointReveal> =
            known_seals
                .map(|rev| (rev.commit_conceal(), rev.clone()))
                .collect();
        let mut counter = 0;
        match self {
            Assignment::Confidential {
                seal_definition,
                assigned_state,
            } => {
                if let Some(reveal) = known_seals.get(seal_definition) {
                    *self = Assignment::ConfidentialAmount {
                        seal_definition: seal::Revealed::TxOutpoint(
                            reveal.clone(),
                        ),
                        assigned_state: assigned_state.clone(),
                    };
                    counter += 1;
                };
            }
            Assignment::ConfidentialSeal {
                seal_definition,
                assigned_state,
            } => {
                if let Some(reveal) = known_seals.get(seal_definition) {
                    *self = Assignment::Revealed {
                        seal_definition: seal::Revealed::TxOutpoint(
                            reveal.clone(),
                        ),
                        assigned_state: assigned_state.clone(),
                    };
                    counter += 1;
                };
            }
            _ => {}
        }
        counter
    }
pub fn reveal_seals < ' a > ( & mut self , known_seals : impl Iterator < Item = & ' a OutpointReveal > , ) -> usize { let known_seals : HashMap < seal :: Confidential , OutpointReveal > = known_seals . map ( | rev | ( rev . commit_conceal ( ) , rev . clone ( ) ) ) . collect ( ) ; let mut counter = 0 ; match self { Assignment :: Confidential { seal_definition , assigned_state , } => { if let Some ( reveal ) = known_seals . get ( seal_definition ) { * self = Assignment :: ConfidentialAmount { seal_definition : seal :: Revealed :: TxOutpoint ( reveal . clone ( ) , ) , assigned_state : assigned_state . clone ( ) , } ; counter += 1 ; } ; } Assignment :: ConfidentialSeal { seal_definition , assigned_state , } => { if let Some ( reveal ) = known_seals . get ( seal_definition ) { * self = Assignment :: Revealed { seal_definition : seal :: Revealed :: TxOutpoint ( reveal . clone ( ) , ) , assigned_state : assigned_state . clone ( ) , } ; counter += 1 ; } ; } _ => { } } counter }
Reveals previously known seal information (replacing blind UTXOs with
unblind ones).
Reveals previously known seal information ( replacing blind UTXOs with unblind ones ) .
&mut self
known_seals
impl Iterator<Item = &'a OutpointReveal>