Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
dcou: make internal function pub conditionally (#32822)
Browse files Browse the repository at this point in the history
dcou: make internal function pub conditionally
  • Loading branch information
ryoqun authored Aug 13, 2023
1 parent 58cca78 commit ce63640
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ prost = "0.11.9"
prost-types = "0.11.9"
protobuf-src = "1.1.0"
qstring = "0.7.2"
qualifier_attr = "0.1.6"
quinn = "0.10.2"
quinn-proto = "0.10.2"
quote = "1.0"
Expand Down
1 change: 1 addition & 0 deletions accounts-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ num_enum = { workspace = true }
once_cell = { workspace = true }
ouroboros = { workspace = true }
percentage = { workspace = true }
qualifier_attr = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
Expand Down
11 changes: 3 additions & 8 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
//! tracks the number of commits to the entire data store. So the latest
//! commit for each slot entry would be indexed.

#[cfg(feature = "dev-context-only-utils")]
use qualifier_attr::fn_qualifiers;
use {
crate::{
account_info::{AccountInfo, StorageLocation},
Expand Down Expand Up @@ -7898,6 +7900,7 @@ impl AccountsDb {
/// Set the accounts delta hash for `slot` in the `accounts_delta_hashes` map
///
/// returns the previous accounts delta hash for `slot`
#[cfg_attr(feature = "dev-context-only-utils", fn_qualifiers(pub))]
fn set_accounts_delta_hash(
&self,
slot: Slot,
Expand Down Expand Up @@ -9581,14 +9584,6 @@ impl AccountsDb {
&self.accounts_delta_hashes
}

pub fn set_accounts_delta_hash_for_tests(
&self,
slot: Slot,
accounts_delta_hash: AccountsDeltaHash,
) {
self.set_accounts_delta_hash(slot, accounts_delta_hash);
}

pub fn accounts_hashes(&self) -> &Mutex<HashMap<Slot, (AccountsHash, /*capitalization*/ u64)>> {
&self.accounts_hashes
}
Expand Down
12 changes: 12 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions runtime/src/bank/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,7 @@ mod tests {
bank.rc
.accounts
.accounts_db
.set_accounts_delta_hash_for_tests(
bank.slot(),
AccountsDeltaHash(Hash::new_unique()),
);
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
bank.rc
.accounts
.accounts_db
Expand Down Expand Up @@ -546,7 +543,7 @@ mod tests {
bank.rc
.accounts
.accounts_db
.set_accounts_delta_hash_for_tests(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
bank.rc
.accounts
.accounts_db
Expand Down Expand Up @@ -628,10 +625,7 @@ mod tests {
bank.rc
.accounts
.accounts_db
.set_accounts_delta_hash_for_tests(
bank.slot(),
AccountsDeltaHash(Hash::new_unique()),
);
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
bank.rc
.accounts
.accounts_db
Expand Down

0 comments on commit ce63640

Please sign in to comment.