Enable remote-wallet signing in solana-keygen (#8267)

* Add fallible methods to KeypairUtil

* Add RemoteKeypair struct and impl KeypairUtil

* Implement RemoteKeypair in keygen; also add parse_keypair_path for cleanup
This commit is contained in:
Tyera Eulberg
2020-02-13 14:08:35 -07:00
committed by GitHub
parent ab475e4849
commit 2374cf09e2
8 changed files with 150 additions and 85 deletions

View File

@@ -1,5 +1,9 @@
use crate::remote_wallet::{
initialize_wallet_manager, DerivationPath, RemoteWallet, RemoteWalletError, RemoteWalletInfo,
use crate::{
remote_keypair::RemoteKeypair,
remote_wallet::{
initialize_wallet_manager, DerivationPath, RemoteWallet, RemoteWalletError,
RemoteWalletInfo, RemoteWalletType,
},
};
use dialoguer::{theme::ColorfulTheme, Select};
use log::*;
@@ -365,3 +369,13 @@ pub fn get_ledger_from_info(
};
wallet_manager.get_ledger(&wallet_base_pubkey)
}
pub fn generate_remote_keypair(
ledger: Arc<LedgerWallet>,
derivation_path: DerivationPath,
) -> RemoteKeypair {
RemoteKeypair {
wallet_type: RemoteWalletType::Ledger(ledger),
derivation_path,
}
}