Merge vote new and register transactions

This commit is contained in:
Michael Vines
2018-11-28 20:10:30 -08:00
parent 5c71f2a439
commit fa359c6fc4
4 changed files with 45 additions and 84 deletions

View File

@ -642,13 +642,13 @@ mod tests {
assert!(client.poll_for_signature(&signature).is_ok());
// Create the vote account
// Create and register the vote account
let validator_vote_account_keypair = Keypair::new();
let vote_account_id = validator_vote_account_keypair.pubkey();
let last_id = client.get_last_id();
let transaction =
VoteTransaction::vote_account_new(&validator_keypair, vote_account_id, last_id, 1);
VoteTransaction::vote_account_new(&validator_keypair, vote_account_id, last_id, 1, 1);
let signature = client.transfer_signed(&transaction).unwrap();
assert!(client.poll_for_signature(&signature).is_ok());
@ -656,13 +656,6 @@ mod tests {
.expect("Expected balance for new account to exist");
assert_eq!(balance, 1);
// Register the vote account to the validator
let last_id = client.get_last_id();
let transaction =
VoteTransaction::vote_account_register(&validator_keypair, vote_account_id, last_id, 0);
let signature = client.transfer_signed(&transaction).unwrap();
assert!(client.poll_for_signature(&signature).is_ok());
const LAST: usize = 30;
for run in 0..=LAST {
println!("Checking for account registered: {}", run);