Remove redundant code from Bank::wrap_with_bank_forks_for_tests() (#34448)
The same initialization occurs when the Bank is inserted into a new BankForks, so no need to duplicate the logic in this test function
This commit is contained in:
parent
d36b211120
commit
fe7970ce46
|
@ -8166,14 +8166,9 @@ impl Bank {
|
||||||
#[cfg(feature = "dev-context-only-utils")]
|
#[cfg(feature = "dev-context-only-utils")]
|
||||||
impl Bank {
|
impl Bank {
|
||||||
pub fn wrap_with_bank_forks_for_tests(self) -> (Arc<Self>, Arc<RwLock<BankForks>>) {
|
pub fn wrap_with_bank_forks_for_tests(self) -> (Arc<Self>, Arc<RwLock<BankForks>>) {
|
||||||
let bank_fork = BankForks::new_rw_arc(self);
|
let bank_forks = BankForks::new_rw_arc(self);
|
||||||
let bank_arc = bank_fork.read().unwrap().root_bank();
|
let bank = bank_forks.read().unwrap().root_bank();
|
||||||
bank_arc
|
(bank, bank_forks)
|
||||||
.loaded_programs_cache
|
|
||||||
.write()
|
|
||||||
.unwrap()
|
|
||||||
.set_fork_graph(bank_fork.clone());
|
|
||||||
(bank_arc, bank_fork)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_for_tests() -> Self {
|
pub fn default_for_tests() -> Self {
|
||||||
|
|
Loading…
Reference in New Issue