Deprecate Instruction::new (#15695)

This commit is contained in:
Jack May
2021-03-03 21:46:48 -08:00
committed by GitHub
parent d6ea2f392b
commit b53cb8eb2d
32 changed files with 272 additions and 207 deletions

View File

@ -121,7 +121,7 @@ fn initialize_account(vote_pubkey: &Pubkey, vote_init: &VoteInit) -> Instruction
AccountMeta::new_readonly(vote_init.node_pubkey, true),
];
Instruction::new(
Instruction::new_with_bincode(
id(),
&VoteInstruction::InitializeAccount(*vote_init),
account_metas,
@ -175,7 +175,7 @@ pub fn authorize(
AccountMeta::new_readonly(*authorized_pubkey, true),
];
Instruction::new(
Instruction::new_with_bincode(
id(),
&VoteInstruction::Authorize(*new_authorized_pubkey, vote_authorize),
account_metas,
@ -193,7 +193,7 @@ pub fn update_validator_identity(
AccountMeta::new_readonly(*authorized_withdrawer_pubkey, true),
];
Instruction::new(
Instruction::new_with_bincode(
id(),
&VoteInstruction::UpdateValidatorIdentity,
account_metas,
@ -210,7 +210,7 @@ pub fn update_commission(
AccountMeta::new_readonly(*authorized_withdrawer_pubkey, true),
];
Instruction::new(
Instruction::new_with_bincode(
id(),
&VoteInstruction::UpdateCommission(commission),
account_metas,
@ -225,7 +225,7 @@ pub fn vote(vote_pubkey: &Pubkey, authorized_voter_pubkey: &Pubkey, vote: Vote)
AccountMeta::new_readonly(*authorized_voter_pubkey, true),
];
Instruction::new(id(), &VoteInstruction::Vote(vote), account_metas)
Instruction::new_with_bincode(id(), &VoteInstruction::Vote(vote), account_metas)
}
pub fn vote_switch(
@ -241,7 +241,7 @@ pub fn vote_switch(
AccountMeta::new_readonly(*authorized_voter_pubkey, true),
];
Instruction::new(
Instruction::new_with_bincode(
id(),
&VoteInstruction::VoteSwitch(vote, proof_hash),
account_metas,
@ -260,7 +260,7 @@ pub fn withdraw(
AccountMeta::new_readonly(*authorized_withdrawer_pubkey, true),
];
Instruction::new(id(), &VoteInstruction::Withdraw(lamports), account_metas)
Instruction::new_with_bincode(id(), &VoteInstruction::Withdraw(lamports), account_metas)
}
fn verify_rent_exemption(