Remove active features stake program v3 and v4 (#22612)
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
This commit is contained in:
@ -256,28 +256,17 @@ impl Meta {
|
||||
&mut self,
|
||||
lockup: &LockupArgs,
|
||||
signers: &HashSet<Pubkey>,
|
||||
clock: Option<&Clock>,
|
||||
clock: &Clock,
|
||||
) -> Result<(), InstructionError> {
|
||||
match clock {
|
||||
None => {
|
||||
// pre-stake_program_v4 behavior: custodian can set lockups at any time
|
||||
if !signers.contains(&self.lockup.custodian) {
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
}
|
||||
Some(clock) => {
|
||||
// post-stake_program_v4 behavior:
|
||||
// * custodian can update the lockup while in force
|
||||
// * withdraw authority can set a new lockup
|
||||
//
|
||||
if self.lockup.is_in_force(clock, None) {
|
||||
if !signers.contains(&self.lockup.custodian) {
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
} else if !signers.contains(&self.authorized.withdrawer) {
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
// post-stake_program_v4 behavior:
|
||||
// * custodian can update the lockup while in force
|
||||
// * withdraw authority can set a new lockup
|
||||
if self.lockup.is_in_force(clock, None) {
|
||||
if !signers.contains(&self.lockup.custodian) {
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
} else if !signers.contains(&self.authorized.withdrawer) {
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
if let Some(unix_timestamp) = lockup.unix_timestamp {
|
||||
self.lockup.unix_timestamp = unix_timestamp;
|
||||
|
Reference in New Issue
Block a user