Skip to content

Commit

Permalink
move dev func to dcu block
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Dec 13, 2024
1 parent fcff549 commit dd8543a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7536,15 +7536,6 @@ impl AccountsDb {
}
}

/// Wrapper function to calculate accounts delta hash for `slot` (only used for testing and benchmarking.)
///
/// As part of calculating the accounts delta hash, get a list of accounts modified this slot
/// (aka dirty pubkeys) and add them to `self.uncleaned_pubkeys` for future cleaning.
#[cfg(feature = "dev-context-only-utils")]
pub fn calculate_accounts_delta_hash(&self, slot: Slot) -> AccountsDeltaHash {
self.calculate_accounts_delta_hash_internal(slot, None, HashMap::default())
}

/// Calculate accounts delta hash for `slot`
///
/// As part of calculating the accounts delta hash, get a list of accounts modified this slot
Expand Down Expand Up @@ -9299,6 +9290,22 @@ impl AccountStorageEntry {
// These functions/fields are only usable from a dev context (i.e. tests and benches)
#[cfg(feature = "dev-context-only-utils")]
impl AccountsDb {
/// useful to adapt tests written prior to introduction of the write cache
/// to use the write cache
pub fn add_root_and_flush_write_cache(&self, slot: Slot) {
self.add_root(slot);
self.flush_root_write_cache(slot);
}

/// Wrapper function to calculate accounts delta hash for `slot` (only used for testing and benchmarking.)
///
/// As part of calculating the accounts delta hash, get a list of accounts modified this slot
/// (aka dirty pubkeys) and add them to `self.uncleaned_pubkeys` for future cleaning.
#[cfg(feature = "dev-context-only-utils")]
pub fn calculate_accounts_delta_hash(&self, slot: Slot) -> AccountsDeltaHash {
self.calculate_accounts_delta_hash_internal(slot, None, HashMap::default())
}

pub fn load_without_fixed_root(
&self,
ancestors: &Ancestors,
Expand Down Expand Up @@ -9436,13 +9443,6 @@ impl AccountsDb {
)
}

/// useful to adapt tests written prior to introduction of the write cache
/// to use the write cache
pub fn add_root_and_flush_write_cache(&self, slot: Slot) {
self.add_root(slot);
self.flush_root_write_cache(slot);
}

/// useful to adapt tests written prior to introduction of the write cache
/// to use the write cache
pub fn flush_root_write_cache(&self, root: Slot) {
Expand Down

0 comments on commit dd8543a

Please sign in to comment.