Allow cli users to authorize Staker signed by Withdrawer (#23146)
This commit is contained in:
parent
a6d736572c
commit
88b66ae3a8
|
@ -1384,7 +1384,13 @@ pub fn process_stake_authorize(
|
||||||
if let Some(authorized) = authorized {
|
if let Some(authorized) = authorized {
|
||||||
match authorization_type {
|
match authorization_type {
|
||||||
StakeAuthorize::Staker => {
|
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 => {
|
StakeAuthorize::Withdrawer => {
|
||||||
check_current_authority(&authorized.withdrawer, &authority.pubkey())?;
|
check_current_authority(&authorized.withdrawer, &authority.pubkey())?;
|
||||||
|
|
Loading…
Reference in New Issue