Processors to compile and send LoaderV4 CLI commands (#33228)
* Processors to compile and send LoaderV4 CLI commands * suppress unused code warning * clippy fixes * redeploy program using source buffer * unify deploy and redeploy to a single function * clippy fixes * fixes after testing the CLI frontend
This commit is contained in:
parent
196a354093
commit
5dbc19ccbf
|
@ -5547,6 +5547,7 @@ dependencies = [
|
|||
"solana-client",
|
||||
"solana-config-program",
|
||||
"solana-faucet",
|
||||
"solana-loader-v4-program",
|
||||
"solana-logger",
|
||||
"solana-program-runtime",
|
||||
"solana-pubsub-client",
|
||||
|
|
|
@ -36,6 +36,7 @@ solana-cli-output = { workspace = true }
|
|||
solana-client = { workspace = true }
|
||||
solana-config-program = { workspace = true }
|
||||
solana-faucet = { workspace = true }
|
||||
solana-loader-v4-program = { workspace = true }
|
||||
solana-logger = { workspace = true }
|
||||
solana-program-runtime = { workspace = true }
|
||||
solana-pubsub-client = { workspace = true }
|
||||
|
|
|
@ -34,6 +34,7 @@ pub mod inflation;
|
|||
pub mod memo;
|
||||
pub mod nonce;
|
||||
pub mod program;
|
||||
pub mod program_v4;
|
||||
pub mod spend_utils;
|
||||
pub mod stake;
|
||||
pub mod test_utils;
|
||||
|
|
|
@ -1719,7 +1719,7 @@ fn process_close(
|
|||
}
|
||||
}
|
||||
|
||||
fn calculate_max_chunk_size<F>(create_msg: &F) -> usize
|
||||
pub fn calculate_max_chunk_size<F>(create_msg: &F) -> usize
|
||||
where
|
||||
F: Fn(u32, Vec<u8>) -> Message,
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -77,16 +77,27 @@ pub fn create_buffer(
|
|||
) -> Vec<Instruction> {
|
||||
vec![
|
||||
system_instruction::create_account(payer_address, buffer_address, lamports, 0, &id()),
|
||||
truncate_uninitialized(buffer_address, authority, new_size, recipient_address),
|
||||
]
|
||||
}
|
||||
|
||||
/// Returns the instructions required to set the length of an uninitialized program account.
|
||||
/// This instruction will require the program account to also sign the transaction.
|
||||
pub fn truncate_uninitialized(
|
||||
program_address: &Pubkey,
|
||||
authority: &Pubkey,
|
||||
new_size: u32,
|
||||
recipient_address: &Pubkey,
|
||||
) -> Instruction {
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&LoaderV4Instruction::Truncate { new_size },
|
||||
vec![
|
||||
AccountMeta::new(*buffer_address, true),
|
||||
AccountMeta::new(*program_address, true),
|
||||
AccountMeta::new_readonly(*authority, true),
|
||||
AccountMeta::new(*recipient_address, false),
|
||||
],
|
||||
),
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns the instructions required to set the length of the program account.
|
||||
|
|
Loading…
Reference in New Issue