Skip to content

Commit

Permalink
address latest feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 18, 2023
1 parent 514bc34 commit f202fdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions feature-gate/program/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ pub enum FeatureGateInstruction {
/// Revoke a pending feature activation.
///
/// A "pending" feature activation is a feature account that has been
/// allocated and assigned, but hasn't been processed by the network yet.
/// allocated and assigned, but hasn't yet been updated by the runtime
/// with an `activation_slot`.
///
/// Features that _have_ been processed by the network are activated, and
/// cannot be revoked.
/// Features that _have_ been activated by the runtime cannot be revoked.
///
/// Accounts expected by this instruction:
///
Expand Down
9 changes: 3 additions & 6 deletions feature-gate/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use {
},
};

/// Processes an [RevokePendingActivation](enum.FeatureGateInstruction.html)
/// Processes a [RevokePendingActivation](enum.FeatureGateInstruction.html)
/// instruction.
pub fn process_revoke_pending_activation(
program_id: &Pubkey,
_program_id: &Pubkey,
accounts: &[AccountInfo],
) -> ProgramResult {
let account_info_iter = &mut accounts.iter();
Expand All @@ -28,10 +28,7 @@ pub fn process_revoke_pending_activation(
return Err(ProgramError::MissingRequiredSignature);
}

if feature_info.owner != program_id {
return Err(ProgramError::IllegalOwner);
}

// This will also check the program ID
if Feature::from_account_info(feature_info)?
.activated_at
.is_some()
Expand Down

0 comments on commit f202fdb

Please sign in to comment.