Cleanup - vote_authorize_with_seed (#31759)

vote_authorize_with_seed
This commit is contained in:
Alexander Meißner 2023-05-24 19:26:35 +02:00 committed by GitHub
parent d6a54e0f4d
commit eef2bedbbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 39 deletions

View File

@ -28,12 +28,6 @@ fn process_authorize_with_seed_instruction(
current_authority_derived_key_owner: &Pubkey,
current_authority_derived_key_seed: &str,
) -> Result<(), InstructionError> {
if !invoke_context
.feature_set
.is_active(&feature_set::vote_authorize_with_seed::id())
{
return Err(InstructionError::InvalidInstructionData);
}
let clock = get_sysvar_with_account_check::clock(invoke_context, instruction_context, 1)?;
let mut expected_authority_keys: HashSet<Pubkey> = HashSet::default();
if instruction_context.is_instruction_account_signer(2)? {
@ -1319,22 +1313,6 @@ mod tests {
// Can change authority when base key signs for related derived key.
process_instruction(
&serialize(&VoteInstruction::AuthorizeWithSeed(
VoteAuthorizeWithSeedArgs {
authorization_type,
current_authority_derived_key_owner: current_authority_owner,
current_authority_derived_key_seed: current_authority_seed.clone(),
new_authority: new_authority_pubkey,
},
))
.unwrap(),
transaction_accounts.clone(),
instruction_accounts.clone(),
Ok(()),
);
// Should fail when the `vote_authorize_with_seed` feature is disabled
process_instruction_disabled_features(
&serialize(&VoteInstruction::AuthorizeWithSeed(
VoteAuthorizeWithSeedArgs {
authorization_type,
@ -1346,7 +1324,7 @@ mod tests {
.unwrap(),
transaction_accounts,
instruction_accounts,
Err(InstructionError::InvalidInstructionData),
Ok(()),
);
}
@ -1460,21 +1438,6 @@ mod tests {
// Can change authority when base key signs for related derived key and new authority signs.
process_instruction(
&serialize(&VoteInstruction::AuthorizeCheckedWithSeed(
VoteAuthorizeCheckedWithSeedArgs {
authorization_type,
current_authority_derived_key_owner: current_authority_owner,
current_authority_derived_key_seed: current_authority_seed.clone(),
},
))
.unwrap(),
transaction_accounts.clone(),
instruction_accounts.clone(),
Ok(()),
);
// Should fail when the `vote_authorize_with_seed` feature is disabled
process_instruction_disabled_features(
&serialize(&VoteInstruction::AuthorizeCheckedWithSeed(
VoteAuthorizeCheckedWithSeedArgs {
authorization_type,
@ -1485,7 +1448,7 @@ mod tests {
.unwrap(),
transaction_accounts,
instruction_accounts,
Err(InstructionError::InvalidInstructionData),
Ok(()),
);
}