Skip to content

Commit

Permalink
fix: account for dedicated CLI multisig config field
Browse files Browse the repository at this point in the history
  • Loading branch information
losman0s committed Dec 1, 2023
1 parent 6303c28 commit 16f797e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions clients/rust/marginfi-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ pub enum TxMode {

pub enum CliSigner {
Keypair(Keypair),
Multisig(Pubkey),
}

impl CliSigner {
pub fn pubkey(&self) -> Pubkey {
match self {
CliSigner::Keypair(keypair) => keypair.pubkey(),
CliSigner::Multisig(pubkey) => pubkey.clone(),
}
}
}
Expand All @@ -70,7 +68,6 @@ impl Clone for CliSigner {
fn clone(&self) -> Self {
match self {
CliSigner::Keypair(keypair) => CliSigner::Keypair(clone_keypair(keypair)),
CliSigner::Multisig(pubkey) => CliSigner::Multisig(pubkey.clone()),
}
}
}
Expand All @@ -86,16 +83,12 @@ impl Signer for CliSigner {
) -> Result<Signature, solana_sdk::signature::SignerError> {
match self {
CliSigner::Keypair(keypair) => Ok(keypair.try_sign_message(message)?),
CliSigner::Multisig(_) => Err(solana_sdk::signature::SignerError::Custom(
"Multisig does not support message signing".to_string(),
)),
}
}

fn is_interactive(&self) -> bool {
match self {
CliSigner::Keypair(_) => true,
CliSigner::Multisig(_) => false,
}
}
}
Expand All @@ -106,7 +99,6 @@ impl Deref for CliSigner {
fn deref(&self) -> &Self::Target {
match self {
CliSigner::Keypair(keypair) => keypair,
CliSigner::Multisig(_) => panic!("Multisig cannot sign."),
}
}
}
Expand Down

0 comments on commit 16f797e

Please sign in to comment.