Remove feature switch handling for checking vote init (#20557)

This commit is contained in:
Justin Starry
2021-10-08 23:35:26 -04:00
committed by GitHub
parent d621994fee
commit db9336c99e
4 changed files with 33 additions and 50 deletions

View File

@ -338,7 +338,6 @@ pub fn process_instruction(
keyed_accounts,
first_instruction_account + 2,
)?)?,
invoke_context.is_feature_active(&feature_set::check_init_vote_data::id()),
)
}
VoteInstruction::Authorize(voter_pubkey, vote_authorize) => vote_state::authorize(

View File

@ -710,9 +710,8 @@ pub fn initialize_account<S: std::hash::BuildHasher>(
vote_init: &VoteInit,
signers: &HashSet<Pubkey, S>,
clock: &Clock,
check_data_size: bool,
) -> Result<(), InstructionError> {
if check_data_size && vote_account.data_len()? != VoteState::size_of() {
if vote_account.data_len()? != VoteState::size_of() {
return Err(InstructionError::InvalidAccountData);
}
let versioned = State::<VoteStateVersions>::state(vote_account)?;
@ -842,7 +841,6 @@ mod tests {
},
&signers,
&Clock::default(),
true,
);
assert_eq!(res, Err(InstructionError::MissingRequiredSignature));
@ -860,7 +858,6 @@ mod tests {
},
&signers,
&Clock::default(),
true,
);
assert_eq!(res, Ok(()));
@ -875,7 +872,6 @@ mod tests {
},
&signers,
&Clock::default(),
true,
);
assert_eq!(res, Err(InstructionError::AccountAlreadyInitialized));
@ -893,7 +889,6 @@ mod tests {
},
&signers,
&Clock::default(),
true,
);
assert_eq!(res, Err(InstructionError::InvalidAccountData));
}