diff --git a/src/commands/transfer.rs b/src/commands/transfer.rs index 16f2e5e003f0ec410ac6d06064815c711c6eac92..1a977179979623d2b2bc910c77988465f94c9586 100644 --- a/src/commands/transfer.rs +++ b/src/commands/transfer.rs @@ -1,6 +1,6 @@ use crate::*; -#[cfg(any(feature = "dev", feature = "gdev"))] // find how to get runtime calls +#[cfg(feature = "gdev")] // find how to get runtime calls type Call = runtime::runtime_types::gdev_runtime::RuntimeCall; type BalancesCall = runtime::runtime_types::pallet_balances::pallet::Call; diff --git a/src/commands/vault.rs b/src/commands/vault.rs index 10dcdb16e495d50b514c66cf8c3933f217b78930..a3fa4b2bb1c1ec50560251107b1886c1d8f0fb0b 100644 --- a/src/commands/vault.rs +++ b/src/commands/vault.rs @@ -7,7 +7,7 @@ use crate::*; use age::secrecy::Secret; use sea_orm::ActiveValue::Set; use sea_orm::{ConnectionTrait, TransactionTrait}; -use sea_orm::{DbErr, ModelTrait}; +use sea_orm::ModelTrait; use sp_core::crypto::AddressUri; use std::cell::RefCell; use std::io::{Read, Write}; diff --git a/src/commands/vault/display.rs b/src/commands/vault/display.rs index 935b55e88519068902385ca42b2fa498967c7754..5f024d6abaa64ebecf51841d14ecb8c5ea6cde4d 100644 --- a/src/commands/vault/display.rs +++ b/src/commands/vault/display.rs @@ -62,14 +62,6 @@ pub fn compute_vault_accounts_table_with_g1v1( Ok(table) } -fn add_account_tree_node_to_table( - table: &mut Table, - account_tree_node: &Rc<RefCell<AccountTreeNode>>, -) -> Result<(), GcliError> { - // Appel to the new function with show_g1v1 = true to maintain compatibility - add_account_tree_node_to_table_with_g1v1(table, account_tree_node, true, false) -} - fn add_account_tree_node_to_table_with_g1v1( table: &mut Table, account_tree_node: &Rc<RefCell<AccountTreeNode>>, @@ -88,16 +80,6 @@ fn add_account_tree_node_to_table_with_g1v1( Ok(()) } -/// Computes one or more row of the table for selected account_tree_node -/// -/// For ed25519 keys, will display over 2 rows to also show the base 58 G1v1 public key if show_g1v1 is true -pub fn compute_vault_accounts_row( - account_tree_node: &Rc<RefCell<AccountTreeNode>>, -) -> Result<Vec<Vec<Cell>>, GcliError> { - // Appel to the new function with show_g1v1 = true to maintain compatibility - compute_vault_accounts_row_with_g1v1(account_tree_node, true, false) -} - /// Computes one or more row of the table for selected account_tree_node /// /// For ed25519 keys, will display over 2 rows to also show the base 58 G1v1 public key if show_g1v1 is true diff --git a/src/inputs.rs b/src/inputs.rs index 082313029575334b85d44ce9392121bb406ccd13..ee84a6da655a277a464fa14c5e2c6e2218a5613a 100644 --- a/src/inputs.rs +++ b/src/inputs.rs @@ -8,10 +8,6 @@ pub fn prompt_password() -> Result<String, GcliError> { prompt_password_query("Password") } -pub fn prompt_password_confirm() -> Result<String, GcliError> { - prompt_password_query_confirm("Password") -} - pub fn prompt_password_query(query: impl ToString) -> Result<String, GcliError> { inquire::Password::new(query.to_string().as_str()) .without_confirmation() @@ -39,12 +35,6 @@ pub fn prompt_seed() -> Result<String, GcliError> { .map_err(|e| GcliError::Input(e.to_string())) } -pub fn prompt_password_query_confirm(query: impl ToString) -> Result<String, GcliError> { - inquire::Password::new(query.to_string().as_str()) - .prompt() - .map_err(|e| GcliError::Input(e.to_string())) -} - /// Prompt for a (direct) vault name (cannot contain derivation path) /// /// Also preventing to use '<' and '>' as those are used in the display diff --git a/src/keys.rs b/src/keys.rs index cdbfb4439f7c6fa5bdb26f09f7eaf18c478497db..6097ca59d031422009c51b3051e0221141df03be 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -249,15 +249,6 @@ pub fn seed_from_cesium(id: &str, pwd: &str) -> [u8; 32] { seed } -/// ask user to input a secret -pub fn prompt_secret_substrate() -> sr25519::Pair { - // Only interested in the keypair which is the second element of the tuple - match prompt_secret_substrate_and_compute_keypair(CryptoScheme::Sr25519).1 { - KeyPair::Sr25519(pair) => pair, - _ => panic!("Expected Sr25519 keypair"), - } -} - pub fn prompt_secret_substrate_and_compute_keypair(crypto_scheme: CryptoScheme) -> (String, KeyPair) { loop { println!("Substrate URI can be a mnemonic or a mini-secret ('0x' prefixed seed) together with optional derivation path"); @@ -302,15 +293,6 @@ pub fn prompt_secret_cesium_and_compute_keypair(_crypto_scheme: CryptoScheme) -> } } -/// ask user to input a seed -pub fn prompt_seed() -> sr25519::Pair { - // Only interested in the keypair which is the second element of the tuple - match prompt_seed_and_compute_keypair(CryptoScheme::Sr25519).1 { - KeyPair::Sr25519(pair) => pair, - _ => panic!("Expected Sr25519 keypair"), - } -} - pub fn prompt_seed_and_compute_keypair(crypto_scheme: CryptoScheme) -> (String, KeyPair) { loop { let seed_str = inputs::prompt_seed().unwrap(); @@ -333,15 +315,6 @@ pub fn prompt_seed_and_compute_keypair(crypto_scheme: CryptoScheme) -> (String, } } -/// ask user pass (Cesium format) -pub fn prompt_predefined() -> sr25519::Pair { - // Only interested in the keypair which is the second element of the tuple - match prompt_predefined_and_compute_keypair(CryptoScheme::Sr25519).1 { - KeyPair::Sr25519(pair) => pair, - _ => panic!("Expected Sr25519 keypair"), - } -} - pub fn prompt_predefined_and_compute_keypair(crypto_scheme: CryptoScheme) -> (String, KeyPair) { let deriv = inputs::prompt_password_query("Enter derivation path: ").unwrap(); let suri = predefined_suri(&deriv);