Skip to content

Commit

Permalink
Renames fns to get_account_shared_data() (anza-xyz#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Apr 14, 2024
1 parent 970d925 commit 2ffc7f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ impl<'a> LoadedAccountAccessor<'a> {
// from the storage map after we grabbed the storage entry, the recycler should not
// reset the storage entry until we drop the reference to the storage entry.
maybe_storage_entry
.get_stored_account(*offset)
.get_account_shared_data(*offset)
.expect("If a storage entry was found in the storage map, it must not have been reset yet")
}
_ => self.check_and_get_loaded_account().take_account(),
Expand Down Expand Up @@ -1136,8 +1136,8 @@ impl AccountStorageEntry {
Some(self.accounts.get_stored_account_meta(offset)?.0)
}

fn get_stored_account(&self, offset: usize) -> Option<AccountSharedData> {
self.accounts.get_stored_account(offset)
fn get_account_shared_data(&self, offset: usize) -> Option<AccountSharedData> {
self.accounts.get_account_shared_data(offset)
}

fn add_account(&self, num_bytes: usize) {
Expand Down
4 changes: 2 additions & 2 deletions accounts-db/src/accounts_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ impl AccountsFile {
}

/// return an `AccountSharedData` for an account at `offset`, if any. Otherwise return None.
pub(crate) fn get_stored_account(&self, offset: usize) -> Option<AccountSharedData> {
pub(crate) fn get_account_shared_data(&self, offset: usize) -> Option<AccountSharedData> {
match self {
Self::AppendVec(av) => av.get_stored_account(offset),
Self::AppendVec(av) => av.get_account_shared_data(offset),
Self::TieredStorage(ts) => {
// Note: The conversion here is needed as the AccountsDB currently
// assumes all offsets are multiple of 8 while TieredStorage uses
Expand Down
4 changes: 2 additions & 2 deletions accounts-db/src/append_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl AppendVec {

/// return an `AccountSharedData` for an account at `offset`.
/// This fn can efficiently return exactly what is needed by a caller.
pub(crate) fn get_stored_account(&self, offset: usize) -> Option<AccountSharedData> {
pub(crate) fn get_account_shared_data(&self, offset: usize) -> Option<AccountSharedData> {
let (meta, next) = self.get_type::<StoredMeta>(offset)?;
let (account_meta, next) = self.get_type::<AccountMeta>(next)?;
let next = next + std::mem::size_of::<AccountHash>();
Expand Down Expand Up @@ -593,7 +593,7 @@ impl AppendVec {
offset: usize,
) -> Option<(StoredMeta, solana_sdk::account::AccountSharedData)> {
let r1 = self.get_stored_account_meta(offset);
let r2 = self.get_stored_account(offset);
let r2 = self.get_account_shared_data(offset);
let r3 = self.get_account_meta(offset);
let sizes = self.get_account_sizes(&[offset]);
if r1.is_some() {
Expand Down

0 comments on commit 2ffc7f6

Please sign in to comment.