fn synchronize_validator(
        &mut self,
        rng: &mut NodeRng,
        recipient: ValidatorId,
        sender: ValidatorId,
        pvv: PreValidatedVertex<TestContext>,
        delivery_time: Timestamp,
    ) -> TestRunResult<(PreValidatedVertex<TestContext>, Vec<HighwayMessage>)> {
        // There may be more than one dependency missing and we want to sync all of them.
        loop {
            let validator = self
                .virtual_net
                .validator(&recipient)
                .ok_or(TestRunError::MissingValidator(recipient))?
                .validator();

            let mut messages = vec![];

            match validator.highway().missing_dependency(&pvv) {
                None => return Ok(Ok((pvv, messages))),
                Some(d) => {
                    match self.synchronize_dependency(rng, d, recipient, sender, delivery_time)? {
                        Ok(sync_messages) => {
                            // `hwm` represent messages produced while synchronizing `d`.
                            messages.extend(sync_messages)
                        }
                        Err(vertex_error) => {
                            // An error occurred when trying to synchronize a missing dependency.
                            // We must stop the synchronization process and return it to the caller.
                            return Ok(Err(vertex_error));
                        }
                    }
                }
            }
        }
    }
/// Synchronizes all missing dependencies of `pvv` that `recipient` is missing.
/// If an error occurs during synchronization of one of `pvv`'s dependencies
/// it's returned and the original vertex mustn't be added to the state.
Synchronizes all missing dependencies of `pvv` that `recipient` is missing.
If an error occurs during synchronization of one of `pvv`'s dependencies
it's returned and the original vertex mustn't be added to the state.
Synchronizes all missing dependencies of ` pvv ` that ` recipient ` is missing . If an error occurs during synchronization of one of ` pvv ` ' s dependencies it ' s returned and the original vertex mustn ' t be added to the state .
fn synchronize_validator(
        &mut self,
        rng: &mut NodeRng,
        recipient: ValidatorId,
        sender: ValidatorId,
        pvv: PreValidatedVertex<TestContext>,
        delivery_time: Timestamp,
    ) -> TestRunResult<(PreValidatedVertex<TestContext>, Vec<HighwayMessage>)> {
        // There may be more than one dependency missing and we want to sync all of them.
        loop {
            let validator = self
                .virtual_net
                .validator(&recipient)
                .ok_or(TestRunError::MissingValidator(recipient))?
                .validator();
            let mut messages = vec![];
            match validator.highway().missing_dependency(&pvv) {
                None => return Ok(Ok((pvv, messages))),
                Some(d) => {
                    match self.synchronize_dependency(rng, d, recipient, sender, delivery_time)? {
                        Ok(sync_messages) => {
                            // `hwm` represent messages produced while synchronizing `d`.
                            messages.extend(sync_messages)
                        }
                        Err(vertex_error) => {
                            // An error occurred when trying to synchronize a missing dependency.
                            // We must stop the synchronization process and return it to the caller.
                            return Ok(Err(vertex_error));
                        }
                    }
                }
            }
        }
    }
fn synchronize_validator ( & mut self , rng : & mut NodeRng , recipient : ValidatorId , sender : ValidatorId , pvv : PreValidatedVertex < TestContext > , delivery_time : Timestamp , ) -> TestRunResult < ( PreValidatedVertex < TestContext > , Vec < HighwayMessage > ) > { // There may be more than one dependency missing and we want to sync all of them. loop { let validator = self . virtual_net . validator ( & recipient ) . ok_or ( TestRunError :: MissingValidator ( recipient ) ) ? . validator ( ) ; let mut messages = vec ! [ ] ; match validator . highway ( ) . missing_dependency ( & pvv ) { None => return Ok ( Ok ( ( pvv , messages ) ) ) , Some ( d ) => { match self . synchronize_dependency ( rng , d , recipient , sender , delivery_time ) ? { Ok ( sync_messages ) => { // `hwm` represent messages produced while synchronizing `d`. messages . extend ( sync_messages ) } Err ( vertex_error ) => { // An error occurred when trying to synchronize a missing dependency. // We must stop the synchronization process and return it to the caller. return Ok ( Err ( vertex_error ) ) ; } } } } } }
Synchronizes all missing dependencies of `pvv` that `recipient` is missing.
Synchronizes all missing dependencies of ` pvv ` that ` recipient ` is missing .
&mut self
rng
&mut NodeRng
recipient
ValidatorId
sender
ValidatorId
pvv
PreValidatedVertex<TestContext>
delivery_time
Timestamp
&mut self
rng
&mut NodeRng
recipient
ValidatorId
sender
ValidatorId
pvv
PreValidatedVertex<TestContext>
delivery_time
Timestamp