From 0de09a56acd53c321dfbcc4bbb4e4c20f80090dc Mon Sep 17 00:00:00 2001 From: hana <81144685+2501babe@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:02:39 -0800 Subject: [PATCH] revert account keys length logic --- runtime/src/account_saver.rs | 2 +- svm/src/account_loader.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/account_saver.rs b/runtime/src/account_saver.rs index fa4df885200d83..4d7be1150b89d1 100644 --- a/runtime/src/account_saver.rs +++ b/runtime/src/account_saver.rs @@ -110,7 +110,7 @@ fn collect_accounts_for_successful_tx<'a, T: SVMMessage>( transaction_ref: Option<&'a SanitizedTransaction>, transaction_accounts: &'a [TransactionAccount], ) { - for (i, (address, account)) in transaction_accounts.iter().enumerate() { + for (i, (address, account)) in (0..transaction.account_keys().len()).zip(transaction_accounts) { if !transaction.is_writable(i) { continue; } diff --git a/svm/src/account_loader.rs b/svm/src/account_loader.rs index 0a27b5ae512255..c64b7f38527c9c 100644 --- a/svm/src/account_loader.rs +++ b/svm/src/account_loader.rs @@ -248,7 +248,7 @@ impl<'a, CB: TransactionProcessingCallback> AccountLoader<'a, CB> { message: &impl SVMMessage, transaction_accounts: &[TransactionAccount], ) { - for (i, (address, account)) in transaction_accounts.iter().enumerate() { + for (i, (address, account)) in (0..message.account_keys().len()).zip(transaction_accounts) { if !message.is_writable(i) { continue; }