Skip to content

Commit 341fa62

Browse files
committed
refactor: consolidate process_* functions + fix inner instructions
1 parent 9647f3e commit 341fa62

File tree

3 files changed

+115
-408
lines changed

3 files changed

+115
-408
lines changed

harness/src/compile_accounts.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ use {
1010
std::collections::{HashMap, HashSet},
1111
};
1212

13-
/// Compile accounts for one or more instructions in a transaction context.
14-
///
15-
/// For single-instruction processing, pass a slice with one element:
16-
/// `&[instruction]`.
1713
pub fn compile_accounts<'a>(
1814
instructions: &[Instruction],
1915
accounts: impl Iterator<Item = &'a (Pubkey, Account)>,
@@ -39,14 +35,12 @@ fn build_transaction_accounts(
3935
all_instructions: &[Instruction],
4036
fallback_accounts: &HashMap<Pubkey, Account>,
4137
) -> Vec<(Pubkey, AccountSharedData)> {
42-
// Collect all program IDs from the instructions
4338
let program_ids: HashSet<Pubkey> = all_instructions.iter().map(|ix| ix.program_id).collect();
4439

4540
message
4641
.account_keys()
4742
.iter()
4843
.map(|key| {
49-
// Handle program accounts for any instruction in the batch
5044
if program_ids.contains(key) {
5145
if let Some(provided_account) = accounts.iter().find(|(k, _)| k == key) {
5246
return (*key, AccountSharedData::from(provided_account.1.clone()));

0 commit comments

Comments
 (0)