support issuing vote instructions from system account (#4338)

* issue vote instructions from system account

* fixup

* bring back KeypairUtil
This commit is contained in:
Rob Walker
2019-05-20 13:32:32 -07:00
committed by GitHub
parent 114e2989fa
commit 86e03a6d1b
5 changed files with 156 additions and 67 deletions

View File

@@ -438,8 +438,6 @@ mod tests {
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::{Keypair, KeypairUtil};
use solana_sdk::system_transaction;
use solana_vote_api::vote_instruction;
use solana_vote_api::vote_state::Vote;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
fn create_sample_payment(keypair: &Keypair, hash: Hash) -> Transaction {
@@ -460,12 +458,6 @@ mod tests {
Transaction::new_signed_instructions(&[keypair], vec![ix], hash)
}
fn create_sample_vote(keypair: &Keypair, hash: Hash) -> Transaction {
let pubkey = keypair.pubkey();
let ix = vote_instruction::vote(&pubkey, vec![Vote::new(1)]);
Transaction::new_signed_instructions(&[keypair], vec![ix], hash)
}
#[test]
fn test_entry_verify() {
let zero = Hash::default();
@@ -647,8 +639,7 @@ mod tests {
let hash = Hash::default();
let next_hash = solana_sdk::hash::hash(&hash.as_ref());
let keypair = Keypair::new();
let vote_account = Keypair::new();
let tx_small = create_sample_vote(&vote_account, next_hash);
let tx_small = create_sample_timestamp(&keypair, next_hash);
let tx_large = create_sample_payment(&keypair, next_hash);
let tx_small_size = serialized_size(&tx_small).unwrap() as usize;