Just define BnakSlotDelta type alias (#8186)

automerge
This commit is contained in:
Ryo Onodera
2020-02-10 20:11:37 +09:00
committed by GitHub
parent 1412ee1ca6
commit 485806c488
5 changed files with 18 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
use solana_runtime::accounts_db::AccountStorageEntry;
use solana_runtime::status_cache::SlotDelta;
use solana_sdk::{clock::Slot, transaction};
use solana_runtime::bank::BankSlotDelta;
use solana_sdk::clock::Slot;
use std::path::PathBuf;
use std::sync::mpsc::{Receiver, SendError, Sender};
use std::sync::Arc;
@@ -13,7 +13,7 @@ pub type SnapshotPackageSendError = SendError<SnapshotPackage>;
#[derive(Debug)]
pub struct SnapshotPackage {
pub root: Slot,
pub slot_deltas: Vec<SlotDelta<transaction::Result<()>>>,
pub slot_deltas: Vec<BankSlotDelta>,
pub snapshot_links: TempDir,
pub storage_entries: Vec<Arc<AccountStorageEntry>>,
pub tar_output_file: PathBuf,
@@ -22,7 +22,7 @@ pub struct SnapshotPackage {
impl SnapshotPackage {
pub fn new(
root: Slot,
slot_deltas: Vec<SlotDelta<transaction::Result<()>>>,
slot_deltas: Vec<BankSlotDelta>,
snapshot_links: TempDir,
storage_entries: Vec<Arc<AccountStorageEntry>>,
tar_output_file: PathBuf,

View File

@@ -4,12 +4,10 @@ use bzip2::bufread::BzDecoder;
use fs_extra::dir::CopyOptions;
use log::*;
use solana_measure::measure::Measure;
use solana_runtime::{
bank::{self, deserialize_from_snapshot, Bank, MAX_SNAPSHOT_DATA_FILE_SIZE},
status_cache::SlotDelta,
use solana_runtime::bank::{
self, deserialize_from_snapshot, Bank, BankSlotDelta, MAX_SNAPSHOT_DATA_FILE_SIZE,
};
use solana_sdk::transaction::Result as TransactionResult;
use solana_sdk::{clock::Slot, transaction};
use solana_sdk::clock::Slot;
use std::{
cmp::Ordering,
fs::{self, File},
@@ -362,7 +360,7 @@ pub fn add_snapshot<P: AsRef<Path>>(snapshot_path: P, bank: &Bank) -> Result<Slo
pub fn serialize_status_cache(
slot: Slot,
slot_deltas: &[SlotDelta<TransactionResult<()>>],
slot_deltas: &[BankSlotDelta],
snapshot_links: &TempDir,
) -> Result<()> {
// the status cache is stored as snapshot_path/status_cache
@@ -549,8 +547,7 @@ where
MAX_SNAPSHOT_DATA_FILE_SIZE,
|stream| {
// Rebuild status cache
let slot_deltas: Vec<SlotDelta<transaction::Result<()>>> =
deserialize_from_snapshot(stream)?;
let slot_deltas: Vec<BankSlotDelta> = deserialize_from_snapshot(stream)?;
Ok(slot_deltas)
},