Skip to content
Snippets Groups Projects
Commit 13307c1a authored by Nicolas80's avatar Nicolas80
Browse files

* Changed sorting of children account so that they are sorted by Path value...

* Changed sorting of children account so that they are sorted by Path value (makes more sense when viewing derivations of one account)
* Added display of "Crypto scheme" when making `vault inspect` so that it is more coherent
parent 72462b98
No related branches found
No related tags found
1 merge request!44feat: Can choose between ed25519 ans sr25519
...@@ -554,18 +554,30 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE ...@@ -554,18 +554,30 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE
Subcommand::Inspect { Subcommand::Inspect {
address_or_vault_name, address_or_vault_name,
} => { } => {
let account_tree_node_to_derive = let account_tree_node_to_inspect =
retrieve_account_tree_node(db, address_or_vault_name).await?; retrieve_account_tree_node(db, address_or_vault_name).await?;
println!("Enter password to decrypt the <Base> account key"); println!("Enter password to decrypt the <Base> account key");
let password = inputs::prompt_password()?; let password = inputs::prompt_password()?;
let account_to_derive_secret_suri = vault_account::compute_suri_account_tree_node( let account_to_derive_secret_suri = vault_account::compute_suri_account_tree_node(
&account_tree_node_to_derive, &account_tree_node_to_inspect,
password, password,
)?; )?;
println!("Substrate URI: '{account_to_derive_secret_suri}'");
println!("Substrate URI: '{account_to_derive_secret_suri}'") let base_account_tree_node =
vault_account::get_base_account_tree_node(&account_tree_node_to_inspect);
let crypto_scheme: CryptoScheme = base_account_tree_node
.borrow()
.account
.crypto_scheme
.clone()
.ok_or(GcliError::Logic(
"Base account without crypto_scheme".to_string(),
))?
.into();
println!("Crypto scheme: {}", <&'static str>::from(crypto_scheme));
} }
Subcommand::Migrate => { Subcommand::Migrate => {
println!("Migrating existing key files to db"); println!("Migrating existing key files to db");
......
...@@ -760,6 +760,9 @@ where ...@@ -760,6 +760,9 @@ where
Ok(Some(base_parent_account)) Ok(Some(base_parent_account))
} }
/// Finds direct children of given account.
///
/// Sorts according to the Path as it makes the most sense when viewing derivations of one account.
async fn find_direct_children_accounts<C>( async fn find_direct_children_accounts<C>(
db: &C, db: &C,
current_account: &Model, current_account: &Model,
...@@ -769,7 +772,7 @@ where ...@@ -769,7 +772,7 @@ where
{ {
Entity::find() Entity::find()
.filter(Column::Parent.eq(current_account.address.clone())) .filter(Column::Parent.eq(current_account.address.clone()))
.order_by_asc(Column::Address) .order_by_asc(Column::Path)
.all(db) .all(db)
.await .await
.map_err(GcliError::from) .map_err(GcliError::from)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment