get rid of Accounts new and default (#19100)
This commit is contained in:
committed by
GitHub
parent
216a1b3d74
commit
f771063275
@ -97,15 +97,6 @@ pub struct Accounts {
|
|||||||
pub(crate) account_locks: Mutex<AccountLocks>,
|
pub(crate) account_locks: Mutex<AccountLocks>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Accounts {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
accounts_db: Arc::new(AccountsDb::default()),
|
|
||||||
account_locks: Mutex::default(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// for the load instructions
|
// for the load instructions
|
||||||
pub type TransactionAccounts = Vec<(Pubkey, AccountSharedData)>;
|
pub type TransactionAccounts = Vec<(Pubkey, AccountSharedData)>;
|
||||||
pub type TransactionRent = u64;
|
pub type TransactionRent = u64;
|
||||||
@ -133,20 +124,6 @@ impl Accounts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
|
||||||
paths: Vec<PathBuf>,
|
|
||||||
cluster_type: &ClusterType,
|
|
||||||
shrink_ratio: AccountShrinkThreshold,
|
|
||||||
) -> Self {
|
|
||||||
Self::new_with_config(
|
|
||||||
paths,
|
|
||||||
cluster_type,
|
|
||||||
AccountSecondaryIndexes::default(),
|
|
||||||
false,
|
|
||||||
shrink_ratio,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_with_config_for_benches(
|
pub fn new_with_config_for_benches(
|
||||||
paths: Vec<PathBuf>,
|
paths: Vec<PathBuf>,
|
||||||
cluster_type: &ClusterType,
|
cluster_type: &ClusterType,
|
||||||
|
@ -1375,7 +1375,7 @@ mod tests {
|
|||||||
Rc::new(RefCell::new(Executors::default())),
|
Rc::new(RefCell::new(Executors::default())),
|
||||||
None,
|
None,
|
||||||
Arc::new(FeatureSet::all_enabled()),
|
Arc::new(FeatureSet::all_enabled()),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&blockhash,
|
&blockhash,
|
||||||
&fee_calculator,
|
&fee_calculator,
|
||||||
@ -1989,7 +1989,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2019,7 +2019,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2053,7 +2053,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2179,7 +2179,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2213,7 +2213,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2245,7 +2245,7 @@ mod tests {
|
|||||||
ComputeBudget::new(),
|
ComputeBudget::new(),
|
||||||
Rc::new(RefCell::new(MockComputeMeter::default())),
|
Rc::new(RefCell::new(MockComputeMeter::default())),
|
||||||
&mut ExecuteDetailsTimings::default(),
|
&mut ExecuteDetailsTimings::default(),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
Hash::default(),
|
Hash::default(),
|
||||||
FeeCalculator::default(),
|
FeeCalculator::default(),
|
||||||
@ -2353,7 +2353,7 @@ mod tests {
|
|||||||
Rc::new(RefCell::new(Executors::default())),
|
Rc::new(RefCell::new(Executors::default())),
|
||||||
None,
|
None,
|
||||||
Arc::new(FeatureSet::all_enabled()),
|
Arc::new(FeatureSet::all_enabled()),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&blockhash,
|
&blockhash,
|
||||||
&fee_calculator,
|
&fee_calculator,
|
||||||
@ -2414,7 +2414,7 @@ mod tests {
|
|||||||
Rc::new(RefCell::new(Executors::default())),
|
Rc::new(RefCell::new(Executors::default())),
|
||||||
None,
|
None,
|
||||||
Arc::new(FeatureSet::all_enabled()),
|
Arc::new(FeatureSet::all_enabled()),
|
||||||
Arc::new(Accounts::default()),
|
Arc::new(Accounts::default_for_tests()),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&blockhash,
|
&blockhash,
|
||||||
&fee_calculator,
|
&fee_calculator,
|
||||||
|
Reference in New Issue
Block a user