Cleanup serde snapshot common.rs (#22854)

This commit is contained in:
Brooks Prumo 2022-02-01 05:39:53 -06:00 committed by GitHub
parent 551c24da57
commit 22f6db2e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 12 deletions

View File

@ -44,7 +44,6 @@ use {
},
};
mod common;
mod newer;
mod storage;
mod tests;

View File

@ -1,8 +0,0 @@
use {super::*, std::collections::HashSet};
#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize, AbiExample)]
pub(crate) struct UnusedAccounts {
unused1: HashSet<Pubkey>,
unused2: HashSet<Pubkey>,
unused3: HashMap<Pubkey, u64>,
}

View File

@ -1,17 +1,23 @@
use {
super::{
common::UnusedAccounts,
storage::SerializableAccountStorageEntry,
utils::{serialize_iter_as_map, serialize_iter_as_seq},
*,
},
crate::{ancestors::AncestorsForSerialization, stakes::StakesCache},
solana_measure::measure::Measure,
std::{cell::RefCell, sync::RwLock},
std::{cell::RefCell, collections::HashSet, sync::RwLock},
};
type AccountsDbFields = super::AccountsDbFields<SerializableAccountStorageEntry>;
#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize, AbiExample)]
struct UnusedAccounts {
unused1: HashSet<Pubkey>,
unused2: HashSet<Pubkey>,
unused3: HashMap<Pubkey, u64>,
}
// Deserializable version of Bank which need not be serializable,
// because it's handled by SerializableVersionedBank.
// So, sync fields with it!

View File

@ -305,7 +305,7 @@ mod test_bank_serialize {
// This some what long test harness is required to freeze the ABI of
// Bank's serialization due to versioned nature
#[frozen_abi(digest = "7PcarCw6gpw9Yw8xypdxQP24TFjLiaHyuDkq95cgwtte")]
#[frozen_abi(digest = "HVyzePMkma8T54PymRW32FAgDXpSdom59K6RnPsCNJjj")]
#[derive(Serialize, AbiExample)]
pub struct BankAbiTestWrapperNewer {
#[serde(serialize_with = "wrapper_newer")]