(cherry picked from commit f15dd1b4ef
)
Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
@ -1910,6 +1910,38 @@ fn test_program_bpf_disguised_as_bpf_loader() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "bpf_c")]
|
||||||
|
fn test_program_bpf_c_dup() {
|
||||||
|
solana_logger::setup();
|
||||||
|
|
||||||
|
let GenesisConfigInfo {
|
||||||
|
genesis_config,
|
||||||
|
mint_keypair,
|
||||||
|
..
|
||||||
|
} = create_genesis_config(50);
|
||||||
|
let mut bank = Bank::new(&genesis_config);
|
||||||
|
let (name, id, entrypoint) = solana_bpf_loader_program!();
|
||||||
|
bank.add_builtin(&name, id, entrypoint);
|
||||||
|
|
||||||
|
let account_address = Pubkey::new_unique();
|
||||||
|
let account =
|
||||||
|
AccountSharedData::new_data(42, &[1_u8, 2, 3], &solana_sdk::system_program::id()).unwrap();
|
||||||
|
bank.store_account(&account_address, &account);
|
||||||
|
|
||||||
|
let bank_client = BankClient::new(bank);
|
||||||
|
|
||||||
|
let program_id = load_bpf_program(&bank_client, &bpf_loader::id(), &mint_keypair, "ser");
|
||||||
|
let account_metas = vec![
|
||||||
|
AccountMeta::new_readonly(account_address, false),
|
||||||
|
AccountMeta::new_readonly(account_address, false),
|
||||||
|
];
|
||||||
|
let instruction = Instruction::new_with_bytes(program_id, &[4, 5, 6, 7], account_metas);
|
||||||
|
bank_client
|
||||||
|
.send_and_confirm_instruction(&mint_keypair, instruction)
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "bpf_rust")]
|
#[cfg(feature = "bpf_rust")]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_program_bpf_upgrade_via_cpi() {
|
fn test_program_bpf_upgrade_via_cpi() {
|
||||||
|
Reference in New Issue
Block a user