diff --git a/svm/src/account_saver.rs b/svm/src/account_saver.rs
index 2657e7a7cb9717..f0881050dea4bc 100644
--- a/svm/src/account_saver.rs
+++ b/svm/src/account_saver.rs
@@ -7,15 +7,16 @@ use {
},
solana_sdk::{
account::AccountSharedData, nonce::state::DurableNonce, pubkey::Pubkey,
- transaction::SanitizedTransaction, transaction_context::TransactionAccount,
+ transaction_context::TransactionAccount,
},
+ solana_svm_transaction::svm_message::SVMMessage,
};
// Used to approximate how many accounts will be calculated for storage so that
// vectors are allocated with an appropriate capacity. Doesn't account for some
// optimization edge cases where some write locked accounts have skip storage.
fn max_number_of_accounts_to_collect(
- txs: &[SanitizedTransaction],
+ txs: &[impl SVMMessage],
processing_results: &[TransactionProcessingResult],
) -> usize {
processing_results
@@ -28,22 +29,19 @@ fn max_number_of_accounts_to_collect(
})
.map(
|(processed_tx, tx)| match processed_tx.execution_details.status {
- Ok(_) => tx.message().num_write_locks() as usize,
+ Ok(_) => tx.num_write_locks() as usize,
Err(_) => processed_tx.loaded_transaction.rollback_accounts.count(),
},
)
.sum()
}
-pub fn collect_accounts_to_store<'a>(
- txs: &'a [SanitizedTransaction],
+pub fn collect_accounts_to_store<'a, T: SVMMessage>(
+ txs: &'a [T],
processing_results: &'a mut [TransactionProcessingResult],
durable_nonce: &DurableNonce,
lamports_per_signature: u64,
-) -> (
- Vec<(&'a Pubkey, &'a AccountSharedData)>,
- Vec