Files
solana/ledger/src/snapshot_package.rs
Ryo Onodera d238371b0c Correct missing entry handling to avoid bad warns (#8339)
* Correct missing entry handling to avoid bad warns

* Pass storage entries to AccountStorageSerialize

* Fix CI.....

* Add tests and reorder condition for cheapest first

* Remove unneeded reference
2020-02-21 15:27:55 +09:00

43 lines
1.0 KiB
Rust

use solana_runtime::{accounts_db::SnapshotStorages, bank::BankSlotDelta};
use solana_sdk::clock::Slot;
use solana_sdk::hash::Hash;
use std::{
path::PathBuf,
sync::mpsc::{Receiver, SendError, Sender},
};
use tempfile::TempDir;
pub type SnapshotPackageSender = Sender<SnapshotPackage>;
pub type SnapshotPackageReceiver = Receiver<SnapshotPackage>;
pub type SnapshotPackageSendError = SendError<SnapshotPackage>;
#[derive(Debug)]
pub struct SnapshotPackage {
pub root: Slot,
pub slot_deltas: Vec<BankSlotDelta>,
pub snapshot_links: TempDir,
pub storages: SnapshotStorages,
pub tar_output_file: PathBuf,
pub hash: Hash,
}
impl SnapshotPackage {
pub fn new(
root: Slot,
slot_deltas: Vec<BankSlotDelta>,
snapshot_links: TempDir,
storages: SnapshotStorages,
tar_output_file: PathBuf,
hash: Hash,
) -> Self {
Self {
root,
slot_deltas,
snapshot_links,
storages,
tar_output_file,
hash,
}
}
}