Add sigverify tests
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
use solana_sdk::hash::Hash;
|
||||
use solana_sdk::instruction::CompiledInstruction;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use solana_sdk::system_instruction::SystemInstruction;
|
||||
use solana_sdk::system_program;
|
||||
use solana_sdk::system_transaction::SystemTransaction;
|
||||
use solana_sdk::transaction::Transaction;
|
||||
|
||||
@@ -9,3 +12,27 @@ pub fn test_tx() -> Transaction {
|
||||
let zero = Hash::default();
|
||||
SystemTransaction::new_account(&keypair1, &pubkey1, 42, zero, 0)
|
||||
}
|
||||
|
||||
pub fn test_multisig_tx() -> Transaction {
|
||||
let keypair0 = Keypair::new();
|
||||
let keypair1 = Keypair::new();
|
||||
let keypairs = vec![&keypair0, &keypair1];
|
||||
let lamports = 5;
|
||||
let fee = 2;
|
||||
let blockhash = Hash::default();
|
||||
|
||||
let system_instruction = SystemInstruction::Move { lamports };
|
||||
|
||||
let program_ids = vec![system_program::id(), solana_budget_api::id()];
|
||||
|
||||
let instructions = vec![CompiledInstruction::new(0, &system_instruction, vec![0, 1])];
|
||||
|
||||
Transaction::new_with_compiled_instructions(
|
||||
&keypairs,
|
||||
&[],
|
||||
blockhash,
|
||||
fee,
|
||||
program_ids,
|
||||
instructions,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user