Move MatchAccountOwnerError from append_vec to accounts_file (#34187)
#### Problem MatchAccountOwnerError currently belongs to append_vec. However, it is a public error type that is also required by other AccountsFile implementations such as TieredStorageFile. #### Summary of Changes Move MatchAccountOwnerError from append_vec to accounts_file.
This commit is contained in:
parent
f2878c0c51
commit
db2444bd11
|
@ -31,7 +31,7 @@ use {
|
|||
AccountStorage, AccountStorageStatus, ShrinkInProgress,
|
||||
},
|
||||
accounts_cache::{AccountsCache, CachedAccount, SlotCache},
|
||||
accounts_file::{AccountsFile, AccountsFileError},
|
||||
accounts_file::{AccountsFile, AccountsFileError, MatchAccountOwnerError},
|
||||
accounts_hash::{
|
||||
AccountHash, AccountsDeltaHash, AccountsHash, AccountsHashKind, AccountsHasher,
|
||||
CalcAccountsHashConfig, CalculateHashIntermediate, HashStats, IncrementalAccountsHash,
|
||||
|
@ -54,8 +54,7 @@ use {
|
|||
get_ancient_append_vec_capacity, is_ancient, AccountsToStore, StorageSelector,
|
||||
},
|
||||
append_vec::{
|
||||
aligned_stored_size, AppendVec, MatchAccountOwnerError, APPEND_VEC_MMAPPED_FILES_OPEN,
|
||||
STORE_META_OVERHEAD,
|
||||
aligned_stored_size, AppendVec, APPEND_VEC_MMAPPED_FILES_OPEN, STORE_META_OVERHEAD,
|
||||
},
|
||||
cache_hash_data::{CacheHashData, CacheHashDataFileReference},
|
||||
contains::Contains,
|
||||
|
|
|
@ -4,7 +4,7 @@ use {
|
|||
StorableAccountsWithHashesAndWriteVersions, StoredAccountInfo, StoredAccountMeta,
|
||||
},
|
||||
accounts_hash::AccountHash,
|
||||
append_vec::{AppendVec, AppendVecError, MatchAccountOwnerError},
|
||||
append_vec::{AppendVec, AppendVecError},
|
||||
storable_accounts::StorableAccounts,
|
||||
tiered_storage::error::TieredStorageError,
|
||||
},
|
||||
|
@ -40,6 +40,14 @@ pub enum AccountsFileError {
|
|||
TieredStorageError(#[from] TieredStorageError),
|
||||
}
|
||||
|
||||
#[derive(Error, Debug, PartialEq, Eq)]
|
||||
pub enum MatchAccountOwnerError {
|
||||
#[error("The account owner does not match with the provided list")]
|
||||
NoMatch,
|
||||
#[error("Unable to load the account")]
|
||||
UnableToLoad,
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, AccountsFileError>;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use {
|
|||
AccountMeta, StorableAccountsWithHashesAndWriteVersions, StoredAccountInfo,
|
||||
StoredAccountMeta, StoredMeta, StoredMetaWriteVersion,
|
||||
},
|
||||
accounts_file::{AccountsFileError, Result, ALIGN_BOUNDARY_OFFSET},
|
||||
accounts_file::{AccountsFileError, MatchAccountOwnerError, Result, ALIGN_BOUNDARY_OFFSET},
|
||||
accounts_hash::AccountHash,
|
||||
storable_accounts::StorableAccounts,
|
||||
u64_align,
|
||||
|
@ -96,14 +96,6 @@ impl<'append_vec> Iterator for AppendVecAccountsIter<'append_vec> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Error, Debug, PartialEq, Eq)]
|
||||
pub enum MatchAccountOwnerError {
|
||||
#[error("The account owner does not match with the provided list")]
|
||||
NoMatch,
|
||||
#[error("Unable to load the account")]
|
||||
UnableToLoad,
|
||||
}
|
||||
|
||||
/// References to account data stored elsewhere. Getting an `Account` requires cloning
|
||||
/// (see `StoredAccountMeta::clone_account()`).
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
|
|
Loading…
Reference in New Issue