Refactor sigverify to stage for signing shreds on the GPU (#6635)
automerge
This commit is contained in:
committed by
Grimes
parent
ec50c20400
commit
67f636545a
40
perf/src/test_tx.rs
Normal file
40
perf/src/test_tx.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
use solana_sdk::transaction::Transaction;
|
||||
|
||||
pub fn test_tx() -> Transaction {
|
||||
let keypair1 = Keypair::new();
|
||||
let pubkey1 = keypair1.pubkey();
|
||||
let zero = Hash::default();
|
||||
system_transaction::transfer(&keypair1, &pubkey1, 42, zero)
|
||||
}
|
||||
|
||||
pub fn test_multisig_tx() -> Transaction {
|
||||
let keypair0 = Keypair::new();
|
||||
let keypair1 = Keypair::new();
|
||||
let keypairs = vec![&keypair0, &keypair1];
|
||||
let lamports = 5;
|
||||
let blockhash = Hash::default();
|
||||
|
||||
let transfer_instruction = SystemInstruction::Transfer { lamports };
|
||||
|
||||
let program_ids = vec![system_program::id(), solana_budget_api::id()];
|
||||
|
||||
let instructions = vec![CompiledInstruction::new(
|
||||
0,
|
||||
&transfer_instruction,
|
||||
vec![0, 1],
|
||||
)];
|
||||
|
||||
Transaction::new_with_compiled_instructions(
|
||||
&keypairs,
|
||||
&[],
|
||||
blockhash,
|
||||
program_ids,
|
||||
instructions,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user