Skip to content

Commit

Permalink
Allow cli users to authorize Staker signed by Withdrawer (#23146) (#2…
Browse files Browse the repository at this point in the history
…3176)

(cherry picked from commit 88b66ae)

Co-authored-by: Tyera Eulberg <[email protected]>
  • Loading branch information
mergify[bot] and Tyera Eulberg authored Feb 16, 2022
1 parent 2c1cec4 commit 8d8525e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,13 @@ pub fn process_stake_authorize(
if let Some(authorized) = authorized {
match authorization_type {
StakeAuthorize::Staker => {
check_current_authority(&authorized.staker, &authority.pubkey())?;
// first check authorized withdrawer
check_current_authority(&authorized.withdrawer, &authority.pubkey())
.or_else(|_| {
// ...then check authorized staker. If neither matches, error will
// print the stake key as `expected`
check_current_authority(&authorized.staker, &authority.pubkey())
})?;
}
StakeAuthorize::Withdrawer => {
check_current_authority(&authorized.withdrawer, &authority.pubkey())?;
Expand Down

0 comments on commit 8d8525e

Please sign in to comment.