#![cfg(feature = "test-bpf")] use { assert_matches::*, solana_program::{ instruction::{AccountMeta, Instruction}, pubkey::Pubkey, }, solana_sdk::{signature::Signer, transaction::Transaction}, solana_validator::test_validator::*, }; #[test] fn test_validator_transaction() { let program_id = Pubkey::new_unique(); let (test_validator, payer) = TestValidatorGenesis::default() .add_program("bpf_program_template", program_id) .start(); let (rpc_client, recent_blockhash, _fee_calculator) = test_validator.rpc_client(); let mut transaction = Transaction::new_with_payer( &[Instruction { program_id, accounts: vec![AccountMeta::new(payer.pubkey(), false)], data: vec![1, 2, 3], }], Some(&payer.pubkey()), ); transaction.sign(&[&payer], recent_blockhash); assert_matches!(rpc_client.send_and_confirm_transaction(&transaction), Ok(_)); }