fn create_notification()

in librabft-v2/src/data_sync.rs [82:111]


    fn create_notification(&self, context: &Context) -> Self::Notification {
        // Pass the latest (non-empty) commit certificate across epochs.
        let highest_commit_certificate = match self.record_store().highest_commit_certificate() {
            Some(hqc) => Some(hqc.clone()),
            None => self.epoch_id().previous().and_then(|previous_epoch| {
                self.record_store_at(previous_epoch)
                    .expect("The record store of the previous epoch should exist.")
                    .highest_commit_certificate()
                    .cloned()
            }),
        };
        DataSyncNotification {
            current_epoch: self.epoch_id(),
            highest_commit_certificate,
            highest_quorum_certificate: self.record_store().highest_quorum_certificate().cloned(),
            timeouts: self.record_store().timeouts(),
            current_vote: self.record_store().current_vote(context.author()).cloned(),
            proposed_block: match self.record_store().proposed_block(self.pacemaker()) {
                Some((hash, _, author)) => {
                    // Do not reshare other leaders' proposals.
                    if author == context.author() {
                        Some(self.record_store().block(hash).unwrap().clone())
                    } else {
                        None
                    }
                }
                None => None,
            },
        }
    }