add stake pool support support for hardware wallets in set-manager (#3583)
* add support for hardware wallets in set-manager * clippy * wrap new_manager in &Option<T> type * trigger CI
This commit is contained in:
parent
0bbe9bd7c8
commit
ac47fb1e38
|
@ -1718,7 +1718,7 @@ fn command_withdraw_sol(
|
||||||
fn command_set_manager(
|
fn command_set_manager(
|
||||||
config: &Config,
|
config: &Config,
|
||||||
stake_pool_address: &Pubkey,
|
stake_pool_address: &Pubkey,
|
||||||
new_manager: &Option<Keypair>,
|
new_manager: &Option<Box<dyn Signer>>,
|
||||||
new_fee_receiver: &Option<Pubkey>,
|
new_fee_receiver: &Option<Pubkey>,
|
||||||
) -> CommandResult {
|
) -> CommandResult {
|
||||||
if !config.no_update {
|
if !config.no_update {
|
||||||
|
@ -1729,8 +1729,9 @@ fn command_set_manager(
|
||||||
// If new accounts are missing in the arguments use the old ones
|
// If new accounts are missing in the arguments use the old ones
|
||||||
let (new_manager_pubkey, mut signers): (Pubkey, Vec<&dyn Signer>) = match new_manager {
|
let (new_manager_pubkey, mut signers): (Pubkey, Vec<&dyn Signer>) = match new_manager {
|
||||||
None => (stake_pool.manager, vec![]),
|
None => (stake_pool.manager, vec![]),
|
||||||
Some(value) => (value.pubkey(), vec![value]),
|
Some(value) => (value.pubkey(), vec![value.as_ref()]),
|
||||||
};
|
};
|
||||||
|
|
||||||
let new_fee_receiver = match new_fee_receiver {
|
let new_fee_receiver = match new_fee_receiver {
|
||||||
None => stake_pool.manager_fee_account,
|
None => stake_pool.manager_fee_account,
|
||||||
Some(value) => {
|
Some(value) => {
|
||||||
|
@ -2937,7 +2938,24 @@ fn main() {
|
||||||
}
|
}
|
||||||
("set-manager", Some(arg_matches)) => {
|
("set-manager", Some(arg_matches)) => {
|
||||||
let stake_pool_address = pubkey_of(arg_matches, "pool").unwrap();
|
let stake_pool_address = pubkey_of(arg_matches, "pool").unwrap();
|
||||||
let new_manager: Option<Keypair> = keypair_of(arg_matches, "new_manager");
|
|
||||||
|
let new_manager = if arg_matches.value_of("new_manager").is_some() {
|
||||||
|
let signer = get_signer(
|
||||||
|
arg_matches,
|
||||||
|
"new-manager",
|
||||||
|
arg_matches
|
||||||
|
.value_of("new_manager")
|
||||||
|
.expect("new manager argument not found!"),
|
||||||
|
&mut wallet_manager,
|
||||||
|
SignerFromPathConfig {
|
||||||
|
allow_null_signer: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
Some(signer)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let new_fee_receiver: Option<Pubkey> = pubkey_of(arg_matches, "new_fee_receiver");
|
let new_fee_receiver: Option<Pubkey> = pubkey_of(arg_matches, "new_fee_receiver");
|
||||||
command_set_manager(
|
command_set_manager(
|
||||||
&config,
|
&config,
|
||||||
|
|
Loading…
Reference in New Issue