diff --git a/svm/src/account_loader.rs b/svm/src/account_loader.rs index 5daaac5e2574aa..5153166074f197 100644 --- a/svm/src/account_loader.rs +++ b/svm/src/account_loader.rs @@ -802,12 +802,13 @@ mod tests { impl<'a> From<&'a TestCallbacks> for AccountLoader<'a, TestCallbacks> { fn from(callbacks: &'a TestCallbacks) -> AccountLoader<'a, TestCallbacks> { - AccountLoader::new( + AccountLoader::new_with_account_cache_capacity( None, ProgramCacheForTxBatch::default(), HashMap::default(), callbacks, Arc::::default(), + 0, ) } } @@ -1146,12 +1147,13 @@ mod tests { accounts_map, ..Default::default() }; - let mut account_loader = AccountLoader::new( + let mut account_loader = AccountLoader::new_with_account_cache_capacity( account_overrides, ProgramCacheForTxBatch::default(), HashMap::default(), &callbacks, Arc::new(FeatureSet::all_enabled()), + 0, ); load_transaction( &mut account_loader, @@ -1593,12 +1595,13 @@ mod tests { )), ); - let mut account_loader = AccountLoader::new( + let mut account_loader = AccountLoader::new_with_account_cache_capacity( None, loaded_programs, program_accounts, &mock_bank, Arc::::default(), + 0, ); let mut error_metrics = TransactionErrorMetrics::default(); @@ -2592,12 +2595,13 @@ mod tests { program_cache.replenish(program2, Arc::new(program2_entry)); let test_transaction_data_size = |transaction, expected_size| { - let mut account_loader = AccountLoader::new( + let mut account_loader = AccountLoader::new_with_account_cache_capacity( None, program_cache.clone(), program_accounts.clone(), &mock_bank, Arc::::default(), + 0, ); let loaded_transaction_accounts = load_transaction_accounts( diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index a687e32f1cf854..1257e5175528d5 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -1325,12 +1325,13 @@ mod tests { impl<'a> From<&'a MockBankCallback> for AccountLoader<'a, MockBankCallback> { fn from(callbacks: &'a MockBankCallback) -> AccountLoader<'a, MockBankCallback> { - AccountLoader::new( + AccountLoader::new_with_account_cache_capacity( None, ProgramCacheForTxBatch::default(), HashMap::default(), callbacks, Arc::::default(), + 0, ) } } @@ -2590,67 +2591,6 @@ mod tests { } } - #[test] - fn test_validate_account_override_usage_on_validate_fee() { - /* - The test setups an account override with enough lamport to pass validate fee. - The account_db has the account with minimum rent amount thus would fail the validate_free. - The test verify that the override is used with a passing test of validate fee. - */ - let lamports_per_signature = 5000; - - let message = - new_unchecked_sanitized_message(Message::new(&[], Some(&Pubkey::new_unique()))); - - let fee_payer_address = message.fee_payer(); - let transaction_fee = lamports_per_signature; - let rent_collector = RentCollector::default(); - let min_balance = rent_collector.rent.minimum_balance(0); - - let fee_payer_account = AccountSharedData::new(min_balance, 0, &Pubkey::default()); - let mut mock_accounts = HashMap::new(); - mock_accounts.insert(*fee_payer_address, fee_payer_account.clone()); - - let necessary_balance = min_balance + transaction_fee; - let mut account_overrides = AccountOverrides::default(); - let fee_payer_account_override = - AccountSharedData::new(necessary_balance, 0, &Pubkey::default()); - account_overrides.set_account(fee_payer_address, Some(fee_payer_account_override)); - - let mock_bank = MockBankCallback { - account_shared_data: Arc::new(RwLock::new(mock_accounts)), - ..Default::default() - }; - let mut account_loader = AccountLoader::new( - Some(&account_overrides), - ProgramCacheForTxBatch::default(), - HashMap::default(), - &mock_bank, - Arc::::default(), - ); - - let mut error_counters = TransactionErrorMetrics::default(); - - let result = - TransactionBatchProcessor::::validate_transaction_nonce_and_fee_payer( - &mut account_loader, - &message, - CheckedTransactionDetails { - nonce: None, - lamports_per_signature, - }, - &Hash::default(), - FeeStructure::default().lamports_per_signature, - &rent_collector, - &mut error_counters, - ); - assert!( - result.is_ok(), - "test_account_override_used: {:?}", - result.err() - ); - } - // Ensure `TransactionProcessingCallback::inspect_account()` is called when // validating the fee payer, since that's when the fee payer account is loaded. #[test]