Refactor Vote Program Account setup (#2992)

This commit is contained in:
Sagar Dhawan
2019-02-28 17:08:45 -08:00
committed by GitHub
parent d5f0e49535
commit 20e4edec61
19 changed files with 278 additions and 151 deletions

View File

@ -77,7 +77,7 @@ fn create_and_fund_vote_account(
let last_id = client.get_last_id();
info!("create_and_fund_vote_account last_id={:?}", last_id);
let transaction =
VoteTransaction::new_account(node_keypair, vote_account, last_id, 1, 1);
VoteTransaction::fund_staking_account(node_keypair, vote_account, last_id, 1, 1);
match client.transfer_signed(&transaction) {
Ok(signature) => {
@ -110,7 +110,7 @@ fn create_and_fund_vote_account(
let vote_account_user_data = client.get_account_userdata(&vote_account);
if let Ok(Some(vote_account_user_data)) = vote_account_user_data {
if let Ok(vote_state) = VoteState::deserialize(&vote_account_user_data) {
if vote_state.node_id == pubkey {
if vote_state.delegate_id == pubkey {
return Ok(());
}
}