Skip to main content

deploy_program_bytes

Function deploy_program_bytes 

Source
pub fn deploy_program_bytes(
    litesvm: &mut LiteSVM,
    program_id: &Pubkey,
    program_bytes: &[u8],
) -> Result<(), SolanaKiteError>
Expand description

Deploys a program to the LiteSVM test environment from raw bytes.

This is useful when you have the program binary embedded via include_bytes! or loaded from a non-filesystem source.

§Arguments

  • litesvm - Mutable reference to the LiteSVM instance
  • program_id - The public key where the program should be deployed
  • program_bytes - The compiled program binary as a byte slice

§Errors

Returns an error if the deployment fails.

§Example

use solana_kite::deploy_program_bytes;
use litesvm::LiteSVM;
use solana_pubkey::Pubkey;

let mut litesvm = LiteSVM::new();
let program_id = Pubkey::new_unique();
deploy_program_bytes(&mut litesvm, &program_id, program_bytes).unwrap();