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

Commit ce63640

Browse files
authored
dcou: make internal function pub conditionally (#32822)
dcou: make internal function pub conditionally
1 parent 58cca78 commit ce63640

File tree

6 files changed

+32
-17
lines changed

6 files changed

+32
-17
lines changed

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ prost = "0.11.9"
259259
prost-types = "0.11.9"
260260
protobuf-src = "1.1.0"
261261
qstring = "0.7.2"
262+
qualifier_attr = "0.1.6"
262263
quinn = "0.10.2"
263264
quinn-proto = "0.10.2"
264265
quote = "1.0"

accounts-db/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ num_enum = { workspace = true }
3939
once_cell = { workspace = true }
4040
ouroboros = { workspace = true }
4141
percentage = { workspace = true }
42+
qualifier_attr = { workspace = true }
4243
rand = { workspace = true }
4344
rayon = { workspace = true }
4445
regex = { workspace = true }

accounts-db/src/accounts_db.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
//! tracks the number of commits to the entire data store. So the latest
1919
//! commit for each slot entry would be indexed.
2020

21+
#[cfg(feature = "dev-context-only-utils")]
22+
use qualifier_attr::fn_qualifiers;
2123
use {
2224
crate::{
2325
account_info::{AccountInfo, StorageLocation},
@@ -7898,6 +7900,7 @@ impl AccountsDb {
78987900
/// Set the accounts delta hash for `slot` in the `accounts_delta_hashes` map
78997901
///
79007902
/// returns the previous accounts delta hash for `slot`
7903+
#[cfg_attr(feature = "dev-context-only-utils", fn_qualifiers(pub))]
79017904
fn set_accounts_delta_hash(
79027905
&self,
79037906
slot: Slot,
@@ -9581,14 +9584,6 @@ impl AccountsDb {
95819584
&self.accounts_delta_hashes
95829585
}
95839586

9584-
pub fn set_accounts_delta_hash_for_tests(
9585-
&self,
9586-
slot: Slot,
9587-
accounts_delta_hash: AccountsDeltaHash,
9588-
) {
9589-
self.set_accounts_delta_hash(slot, accounts_delta_hash);
9590-
}
9591-
95929587
pub fn accounts_hashes(&self) -> &Mutex<HashMap<Slot, (AccountsHash, /*capitalization*/ u64)>> {
95939588
&self.accounts_hashes
95949589
}

programs/sbf/Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/src/bank/serde_snapshot.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,7 @@ mod tests {
352352
bank.rc
353353
.accounts
354354
.accounts_db
355-
.set_accounts_delta_hash_for_tests(
356-
bank.slot(),
357-
AccountsDeltaHash(Hash::new_unique()),
358-
);
355+
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
359356
bank.rc
360357
.accounts
361358
.accounts_db
@@ -546,7 +543,7 @@ mod tests {
546543
bank.rc
547544
.accounts
548545
.accounts_db
549-
.set_accounts_delta_hash_for_tests(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
546+
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
550547
bank.rc
551548
.accounts
552549
.accounts_db
@@ -628,10 +625,7 @@ mod tests {
628625
bank.rc
629626
.accounts
630627
.accounts_db
631-
.set_accounts_delta_hash_for_tests(
632-
bank.slot(),
633-
AccountsDeltaHash(Hash::new_unique()),
634-
);
628+
.set_accounts_delta_hash(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
635629
bank.rc
636630
.accounts
637631
.accounts_db

0 commit comments

Comments
 (0)