Skip to content

Commit

Permalink
Sends both instructions of process_close_program() in a single transa…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
Lichtso committed Feb 27, 2025
1 parent 46931d9 commit bf7d50f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cli/src/program_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,16 +850,14 @@ fn process_close_program(
let retract_instruction =
build_retract_instruction(&program_account, program_address, &authority_pubkey)?;

let mut initial_messages = if let Some(instruction) = retract_instruction {
vec![message(vec![instruction])?]
} else {
vec![]
};

let mut instructions = Vec::default();
if let Some(retract_instruction) = retract_instruction {
instructions.push(retract_instruction);
}
let set_program_length_instruction =
instruction::set_program_length(program_address, &authority_pubkey, 0, &payer_pubkey);

initial_messages.push(message(vec![set_program_length_instruction])?);
instructions.push(set_program_length_instruction);
let initial_messages = [message(instructions)?];

check_payer(rpc_client.clone(), config, 0, &initial_messages, &[], &[])?;

Expand Down

0 comments on commit bf7d50f

Please sign in to comment.