pub fn wait_for_next_snapshot(
        &self,
        snapshot_archives_dir: impl AsRef<Path>,
        next_snapshot_type: NextSnapshotType,
    ) -> NextSnapshotResult {
        // Get slot after which this was generated
        let client = self
            .get_validator_client(&self.entry_point_info.id)
            .unwrap();
        let last_slot = client
            .get_slot_with_commitment(CommitmentConfig::processed())
            .expect("Couldn't get slot");

        // Wait for a snapshot for a bank >= last_slot to be made so we know that the snapshot
        // must include the transactions just pushed
        trace!(
            "Waiting for {:?} snapshot archive to be generated with slot >= {}",
            next_snapshot_type,
            last_slot
        );
        loop {
            if let Some(full_snapshot_archive_info) =
                snapshot_utils::get_highest_full_snapshot_archive_info(&snapshot_archives_dir)
            {
                match next_snapshot_type {
                    NextSnapshotType::FullSnapshot => {
                        if full_snapshot_archive_info.slot() >= last_slot {
                            return NextSnapshotResult::FullSnapshot(full_snapshot_archive_info);
                        }
                    }
                    NextSnapshotType::IncrementalAndFullSnapshot => {
                        if let Some(incremental_snapshot_archive_info) =
                            snapshot_utils::get_highest_incremental_snapshot_archive_info(
                                &snapshot_archives_dir,
                                full_snapshot_archive_info.slot(),
                            )
                        {
                            if incremental_snapshot_archive_info.slot() >= last_slot {
                                return NextSnapshotResult::IncrementalAndFullSnapshot(
                                    incremental_snapshot_archive_info,
                                    full_snapshot_archive_info,
                                );
                            }
                        }
                    }
                }
            }
            sleep(Duration::from_secs(5));
        }
    }
/// Return the next snapshot archive infos after the cluster's last processed slot
Return the next snapshot archive infos after the cluster's last processed slot
Return the next snapshot archive infos after the cluster ' s last processed slot
pub fn wait_for_next_snapshot(
        &self,
        snapshot_archives_dir: impl AsRef<Path>,
        next_snapshot_type: NextSnapshotType,
    ) -> NextSnapshotResult {
        // Get slot after which this was generated
        let client = self
            .get_validator_client(&self.entry_point_info.id)
            .unwrap();
        let last_slot = client
            .get_slot_with_commitment(CommitmentConfig::processed())
            .expect("Couldn't get slot");
        // Wait for a snapshot for a bank >= last_slot to be made so we know that the snapshot
        // must include the transactions just pushed
        trace!(
            "Waiting for {:?} snapshot archive to be generated with slot >= {}",
            next_snapshot_type,
            last_slot
        );
        loop {
            if let Some(full_snapshot_archive_info) =
                snapshot_utils::get_highest_full_snapshot_archive_info(&snapshot_archives_dir)
            {
                match next_snapshot_type {
                    NextSnapshotType::FullSnapshot => {
                        if full_snapshot_archive_info.slot() >= last_slot {
                            return NextSnapshotResult::FullSnapshot(full_snapshot_archive_info);
                        }
                    }
                    NextSnapshotType::IncrementalAndFullSnapshot => {
                        if let Some(incremental_snapshot_archive_info) =
                            snapshot_utils::get_highest_incremental_snapshot_archive_info(
                                &snapshot_archives_dir,
                                full_snapshot_archive_info.slot(),
                            )
                        {
                            if incremental_snapshot_archive_info.slot() >= last_slot {
                                return NextSnapshotResult::IncrementalAndFullSnapshot(
                                    incremental_snapshot_archive_info,
                                    full_snapshot_archive_info,
                                );
                            }
                        }
                    }
                }
            }
            sleep(Duration::from_secs(5));
        }
    }
pub fn wait_for_next_snapshot ( & self , snapshot_archives_dir : impl AsRef < Path > , next_snapshot_type : NextSnapshotType , ) -> NextSnapshotResult { // Get slot after which this was generated let client = self . get_validator_client ( & self . entry_point_info . id ) . unwrap ( ) ; let last_slot = client . get_slot_with_commitment ( CommitmentConfig :: processed ( ) ) . expect ( " " ) ; // Wait for a snapshot for a bank >= last_slot to be made so we know that the snapshot // must include the transactions just pushed trace ! ( " " next_snapshot_type last_slot ) ; loop { if let Some ( full_snapshot_archive_info ) = snapshot_utils :: get_highest_full_snapshot_archive_info ( & snapshot_archives_dir ) { match next_snapshot_type { NextSnapshotType :: FullSnapshot => { if full_snapshot_archive_info . slot ( ) >= last_slot { return NextSnapshotResult :: FullSnapshot ( full_snapshot_archive_info ) ; } } NextSnapshotType :: IncrementalAndFullSnapshot => { if let Some ( incremental_snapshot_archive_info ) = snapshot_utils :: get_highest_incremental_snapshot_archive_info ( & snapshot_archives_dir , full_snapshot_archive_info . slot ( ) , ) { if incremental_snapshot_archive_info . slot ( ) >= last_slot { return NextSnapshotResult :: IncrementalAndFullSnapshot ( incremental_snapshot_archive_info , full_snapshot_archive_info , ) ; } } } } } sleep ( Duration :: from_secs ( 5 ) ) ; } }
Return the next snapshot archive infos after the cluster's last processed slot
Return the next snapshot archive infos after the cluster ' s last processed slot
&self
snapshot_archives_dir
impl AsRef<Path>
next_snapshot_type
NextSnapshotType