Skip to content
Snippets Groups Projects
Commit a36c8318 authored by poka's avatar poka
Browse files

remove unused methods

parent e9cd6a99
No related branches found
No related tags found
2 merge requests!45Nostr,!44feat: Can choose between ed25519 ans sr25519
Pipeline #40104 passed
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;
......
......@@ -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};
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment