You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create the buffer account only if it does not already exist.
471
455
// Subsequent applies reuse the same PDA and only reallocate its data.
472
456
if buffer.lamports() == 0{
@@ -487,7 +471,8 @@ fn apply_impl<'info>(
487
471
)?;
488
472
}
489
473
490
-
for(program, component)in&pairs {
474
+
for pair in remaining_accounts[..index].chunks(2){
475
+
let[program, component] = pair else{continue};
491
476
buffer.realloc(component.data_len(),false)?;
492
477
{
493
478
letmut data = buffer.try_borrow_mut_data()?;
@@ -519,12 +504,14 @@ fn apply_impl<'info>(
519
504
}
520
505
}
521
506
507
+
let cpi_remaining_accounts = remaining_accounts[..index].iter().skip(1).step_by(2).chain(remaining_accounts[index..].iter().skip(1)).cloned().collect::<Vec<_>>();
0 commit comments