diff --git a/src/commands/vault.rs b/src/commands/vault.rs index 0be934af2cc5dc511caa4c67531ac12b848aada2..5fe703f07464f85b8bd7ab9dff3a56ba0b223089 100644 --- a/src/commands/vault.rs +++ b/src/commands/vault.rs @@ -142,9 +142,6 @@ pub enum ListChoice { /// Show G1v1 public key for ed25519 keys #[clap(long)] show_g1v1: bool, - /// Show wallet type (g1v1 or mnemonic) - #[clap(long)] - show_type: bool, }, /// List only base accounts #[clap(alias = "b")] @@ -152,9 +149,6 @@ pub enum ListChoice { /// Show G1v1 public key for ed25519 keys #[clap(long)] show_g1v1: bool, - /// Show wallet type (g1v1 or mnemonic) - #[clap(long)] - show_type: bool, }, /// List accounts for a specific address #[clap(alias = "f")] @@ -164,18 +158,12 @@ pub enum ListChoice { /// Show G1v1 public key for ed25519 keys #[clap(long)] show_g1v1: bool, - /// Show wallet type (g1v1 or mnemonic) - #[clap(long)] - show_type: bool, }, } impl Default for ListChoice { fn default() -> Self { - ListChoice::All { - show_g1v1: false, - show_type: false, - } + ListChoice::All { show_g1v1: false } } } @@ -229,33 +217,25 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE // match subcommand match command { Subcommand::List(choice) => match choice { - ListChoice::All { - show_g1v1, - show_type, - } => { + ListChoice::All { show_g1v1 } => { let all_account_tree_node_hierarchies = vault_account::fetch_all_base_account_tree_node_hierarchies(db).await?; let table = display::compute_vault_accounts_table_with_g1v1( &all_account_tree_node_hierarchies, show_g1v1, - show_type, )?; println!("available SS58 Addresses:"); println!("{table}"); } - ListChoice::Base { - show_g1v1, - show_type, - } => { + ListChoice::Base { show_g1v1 } => { let base_account_tree_nodes = vault_account::fetch_only_base_account_tree_nodes(db).await?; let table = display::compute_vault_accounts_table_with_g1v1( &base_account_tree_nodes, show_g1v1, - show_type, )?; println!("available <Base> SS58 Addresses:"); @@ -264,7 +244,6 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE ListChoice::For { address_or_vault_name, show_g1v1, - show_type, } => { let account_tree_node = retrieve_account_tree_node(db, address_or_vault_name).await?; @@ -275,7 +254,6 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE let table = display::compute_vault_accounts_table_with_g1v1( &[base_account_tree_node], show_g1v1, - show_type, )?; println!( @@ -344,7 +322,7 @@ pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliE // Non-interactive mode with provided G1v1 ID and password if secret_format != SecretFormat::G1v1 { return Err(GcliError::Input(format!( - "G1v1 ID and password can only be provided directly with secret_format=g1v1, got: {:?}", + "G1v1 ID and password can only be provided directly with secret_format=g1v1, got: {:?}", secret_format ))); } @@ -924,26 +902,67 @@ pub async fn create_base_account_for_vault_data_to_import<C>( where C: ConnectionTrait, { - let address = vault_data.key_pair.address().to_string(); + let address_to_import = vault_data.key_pair.address().to_string(); + println!("Trying to import for SS58 address :'{}'", address_to_import); + println!(); - // Check if the account already exists - let existing_vault_account = - vault_account::find_by_id(db_tx, &DbAccountId(vault_data.key_pair.address())).await?; + if let Some(existing_vault_account) = + vault_account::find_by_id(db_tx, &DbAccountId::from(address_to_import.clone())).await? + { + // Existing account + if existing_vault_account.is_base_account() { + println!("You are trying to add {address_to_import} as a <Base> account while it already exists as a <Base> account."); + println!(); + println!("Do you want to:"); + println!("1. keep the existing <Base> account and cancel import"); + println!("2. overwrite existing <Base> account with the new encrypted key (children will be re-parented)"); + } else { + // Existing derivation account + let account_tree_node_hierarchy = + vault_account::fetch_base_account_tree_node_hierarchy_unwrapped( + db_tx, + &address_to_import, + ) + .await?; + let account_tree_node_for_address = vault_account::get_account_tree_node_for_address( + &account_tree_node_hierarchy, + &address_to_import, + ); - let password = match password_opt { - Some(password) => password.clone(), - None => inputs::prompt_password_query("Enter password to encrypt the key: ")?, - }; + let base_parent_hierarchy_account_tree_node = + vault_account::get_base_parent_hierarchy_account_tree_node( + &account_tree_node_for_address, + ); - let encrypted_suri = compute_encrypted_suri(password.clone(), vault_data.secret_suri.clone())?; + let parent_hierarchy_table = + display::compute_vault_accounts_table(&[base_parent_hierarchy_account_tree_node])?; + + println!("You are trying to add {address_to_import} as a <Base> account"); + println!( + "but it is already present as `{}` derivation of {} account.", + existing_vault_account.path.clone().unwrap(), + existing_vault_account.parent.clone().unwrap() + ); + println!(); + println!("Its parent hierarchy is this:"); + println!("{parent_hierarchy_table}"); + println!(); + println!("Do you want to:"); + println!("1. keep the existing derivation and cancel import"); + println!("2. delete the derivation account and replace it with the new <Base> account (children will be re-parented)"); + } + + let result = inputs::select_action("Your choice?", vec!["1", "2"])?; + match result { + "2" => { + let password = match password_opt { + Some(password) => password.clone(), + None => inputs::prompt_password_query("Enter password to encrypt the key: ")?, + }; + + let encrypted_suri = + compute_encrypted_suri(password, vault_data.secret_suri.clone())?; - if let Some(existing_vault_account) = existing_vault_account { - // Existing account - match inputs::confirm_action(format!( - "Account {} already exists. Do you want to update it?", - existing_vault_account - ))? { - true => { let name = if let Some(name) = name_opt { validate_vault_name(&name)?; trim_and_reduce_empty_as_none(name) @@ -966,7 +985,6 @@ where )); vault_account.encrypted_suri = Set(Some(encrypted_suri)); vault_account.name = Set(name); - vault_account.secret_format = Set(Some(vault_data.secret_format.into())); let updated_vault_account = vault_account::update_account(db_tx, vault_account).await?; @@ -979,6 +997,11 @@ where //New entry let secret_format = vault_data.secret_format; + let password = match password_opt { + Some(password) => password.clone(), + None => inputs::prompt_password_query("Enter password to encrypt the key: ")?, + }; + let encrypted_suri = compute_encrypted_suri(password, vault_data.secret_suri.clone())?; let name = if let Some(name) = name_opt { @@ -993,11 +1016,10 @@ where let account = vault_account::create_base_account( db_tx, - &address, + &address_to_import, name.as_ref(), crypto_scheme, encrypted_suri, - secret_format, ) .await?; @@ -1290,12 +1312,12 @@ mod tests { Some(String::from("//Alice")) )] #[case( - String::from( - "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice//Bob/soft1/soft2" - ), - Some(String::from("bottom drive obey lake curtain smoke basket hold race lonely fit walk")), - Some(String::from("//Alice//Bob/soft1/soft2")) - )] + String::from( + "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice//Bob/soft1/soft2" + ), + Some(String::from("bottom drive obey lake curtain smoke basket hold race lonely fit walk")), + Some(String::from("//Alice//Bob/soft1/soft2")) + )] #[case( String::from("bottom drive obey lake curtain smoke basket hold race lonely fit walk"), Some(String::from( diff --git a/src/commands/vault/display.rs b/src/commands/vault/display.rs index fe2997185f4f9b6f9fdc2722b9cf26a46de5bad8..8822282464ddc4a7f6874bd0e5c93b6af492b0c3 100644 --- a/src/commands/vault/display.rs +++ b/src/commands/vault/display.rs @@ -27,45 +27,30 @@ pub fn compute_vault_accounts_table( account_tree_nodes: &[Rc<RefCell<AccountTreeNode>>], ) -> Result<Table, GcliError> { // Appel to the new function with show_g1v1 = true to maintain compatibility - compute_vault_accounts_table_with_g1v1(account_tree_nodes, true, false) + compute_vault_accounts_table_with_g1v1(account_tree_nodes, true) } pub fn compute_vault_accounts_table_with_g1v1( account_tree_nodes: &[Rc<RefCell<AccountTreeNode>>], show_g1v1: bool, - show_type: bool, ) -> Result<Table, GcliError> { let mut table = Table::new(); table.load_preset(comfy_table::presets::UTF8_BORDERS_ONLY); // Prepare header based on options - let mut header = vec![ + table.set_header(vec![ if show_g1v1 { "SS58 Address/G1v1 public key" } else { "SS58 Address" }, "Crypto", - ]; - - // Add Type column if show_type is true - if show_type { - header.push("Type"); - } - - // Add remaining columns - header.push("Path"); - header.push("Name"); - - table.set_header(header); + "Path", + "Name", + ]); for account_tree_node in account_tree_nodes { - let _ = add_account_tree_node_to_table_with_g1v1( - &mut table, - account_tree_node, - show_g1v1, - show_type, - ); + let _ = add_account_tree_node_to_table_with_g1v1(&mut table, account_tree_node, show_g1v1); } Ok(table) @@ -75,15 +60,14 @@ fn add_account_tree_node_to_table_with_g1v1( table: &mut Table, account_tree_node: &Rc<RefCell<AccountTreeNode>>, show_g1v1: bool, - show_type: bool, ) -> Result<(), GcliError> { - let rows = compute_vault_accounts_row_with_g1v1(account_tree_node, show_g1v1, show_type)?; + let rows = compute_vault_accounts_row_with_g1v1(account_tree_node, show_g1v1)?; rows.iter().for_each(|row| { table.add_row(row.clone()); }); for child in &account_tree_node.borrow().children { - let _ = add_account_tree_node_to_table_with_g1v1(table, child, show_g1v1, show_type); + let _ = add_account_tree_node_to_table_with_g1v1(table, child, show_g1v1); } Ok(()) @@ -95,7 +79,6 @@ fn add_account_tree_node_to_table_with_g1v1( pub fn compute_vault_accounts_row_with_g1v1( account_tree_node: &Rc<RefCell<AccountTreeNode>>, show_g1v1: bool, - show_type: bool, ) -> Result<Vec<Vec<Cell>>, GcliError> { let empty_string = "".to_string(); @@ -122,26 +105,12 @@ pub fn compute_vault_accounts_row_with_g1v1( let mut rows: Vec<Vec<Cell>> = vec![]; - let (path, crypto, wallet_type) = if let Some(path) = account_tree_node.account.path.clone() { - (path, empty_string.clone(), empty_string.clone()) + let (path, crypto) = if let Some(path) = account_tree_node.account.path.clone() { + (path, empty_string.clone()) } else { let crypto_scheme = CryptoScheme::from(account_tree_node.account.crypto_scheme.unwrap()); let crypto_scheme_str: &str = crypto_scheme.into(); - // Determine the wallet type based on the secret format - let wallet_type = if let Some(secret_format) = &account_tree_node.account.secret_format { - // If the secret format is available, use it to determine the type - match crate::keys::SecretFormat::from(*secret_format) { - crate::keys::SecretFormat::G1v1 => "G1v1".to_string(), - crate::keys::SecretFormat::Substrate => "Mnemonic".to_string(), - crate::keys::SecretFormat::Seed => "Seed".to_string(), - crate::keys::SecretFormat::Predefined => "Predefined".to_string(), - } - } else { - // If the secret format is not available, display "Unknown" - "Unknown".to_string() - }; - // Add a second line for the G1v1 public key only if show_g1v1 is true and it's an Ed25519 key let is_ed25519 = crypto_scheme == CryptoScheme::Ed25519; if show_g1v1 && is_ed25519 { @@ -154,9 +123,6 @@ pub fn compute_vault_accounts_row_with_g1v1( // Add empty cells to align with the main line g1v1_row.push(Cell::new("")); - if show_type { - g1v1_row.push(Cell::new("")); - } g1v1_row.push(Cell::new("")); g1v1_row.push(Cell::new("")); @@ -166,23 +132,19 @@ pub fn compute_vault_accounts_row_with_g1v1( ( format!("<{}>", account_tree_node.account.account_type()), crypto_scheme_str.to_string(), - wallet_type, ) }; // Add the first line - let mut main_row = vec![Cell::new(&address), Cell::new(crypto)]; - - // Add the Type column if show_type is true - if show_type { - main_row.push(Cell::new(wallet_type)); - } - - // Add the remaining columns - main_row.push(Cell::new(&path)); - main_row.push(Cell::new(&name)); - - rows.insert(0, main_row); + rows.insert( + 0, + vec![ + Cell::new(&address), + Cell::new(crypto), + Cell::new(&path), + Cell::new(&name), + ], + ); Ok(rows) } @@ -261,8 +223,7 @@ mod tests { #[test] fn test_compute_vault_accounts_table_with_g1v1_empty() { // Test with show_g1v1 = true (default behavior) - let table = compute_vault_accounts_table_with_g1v1(&[], true, false).unwrap(); - + let table = compute_vault_accounts_table_with_g1v1(&[], true).unwrap(); let expected_table_with_g1v1 = indoc! {r#" ┌─────────────────────────────────────────────────────┠│ SS58 Address/G1v1 public key Crypto Path Name │ @@ -273,8 +234,7 @@ mod tests { assert_eq!(table.to_string(), expected_table_with_g1v1); // Test with show_g1v1 = false - let table = compute_vault_accounts_table_with_g1v1(&[], false, false).unwrap(); - + let table = compute_vault_accounts_table_with_g1v1(&[], false).unwrap(); let expected_table_without_g1v1 = indoc! {r#" ┌─────────────────────────────────────┠│ SS58 Address Crypto Path Name │ @@ -293,8 +253,7 @@ mod tests { // Test with show_g1v1 = true (default behavior) let table_with_g1v1 = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, true, false).unwrap(); - + compute_vault_accounts_table_with_g1v1(&account_tree_nodes, true).unwrap(); let expected_table_with_g1v1 = indoc! {r#" ┌──────────────────────────────────────────────────────────────────────────────────────────┠│ SS58 Address/G1v1 public key Crypto Path Name │ @@ -313,8 +272,7 @@ mod tests { // Test with show_g1v1 = false let table_without_g1v1 = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, false, false).unwrap(); - + compute_vault_accounts_table_with_g1v1(&account_tree_nodes, false).unwrap(); let expected_table_without_g1v1 = indoc! {r#" ┌──────────────────────────────────────────────────────────────────────────────────────────┠│ SS58 Address Crypto Path Name │ @@ -339,8 +297,7 @@ mod tests { // Test with show_g1v1 = true (default behavior) let table_with_g1v1 = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, true, false).unwrap(); - + compute_vault_accounts_table_with_g1v1(&account_tree_nodes, true).unwrap(); let expected_table_with_g1v1 = indoc! {r#" ┌─────────────────────────────────────────────────────────────────────────────────────┠│ SS58 Address/G1v1 public key Crypto Path Name │ @@ -354,8 +311,7 @@ mod tests { // Test with show_g1v1 = false let table_without_g1v1 = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, false, false).unwrap(); - + compute_vault_accounts_table_with_g1v1(&account_tree_nodes, false).unwrap(); let expected_table_without_g1v1 = indoc! {r#" ┌─────────────────────────────────────────────────────────────────────────────────────┠│ SS58 Address Crypto Path Name │ @@ -367,54 +323,5 @@ mod tests { assert_eq!(table_without_g1v1.to_string(), expected_table_without_g1v1); } - - #[test] - fn test_compute_vault_accounts_table_with_type() { - let account_tree_node = mother_account_tree_node(); - let g1v1_account_tree_node = mother_g1v1_account_tree_node(); - let account_tree_nodes = vec![account_tree_node, g1v1_account_tree_node]; - - // Test with show_type = true and show_g1v1 = true - let table_with_g1v1_and_type = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, true, true).unwrap(); - - let expected_table_with_g1v1_and_type = indoc! {r#" - ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┠- │ SS58 Address/G1v1 public key Crypto Type Path Name │ - ╞â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡ - │ 5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV sr25519 Mnemonic <Base> Mother │ - │ ├ 5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH //0 Child 1 │ - │ │ ├ 5Fh5PLQNt1xuEXm71dfDtQdnwceSew4oHewWBLsWAkKspV7d //0 Grandchild 1 │ - │ ├ 5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o //1 <Mother//1> │ - │ │ ├ 5CvdJuB9HLXSi5FS9LW57cyHF13iCv5HDimo2C45KxnxriCT //1 <Mother//1//1> │ - │ 5ET2jhgJFoNQUpgfdSkdwftK8DKWdqZ1FKm5GKWdPfMWhPr4 ed25519 G1v1 <Base> MotherG1v1 │ - │ â”” G1v1: 86pW1doyJPVH3jeDPZNQa1UZFBo5zcdvHERcaeE758W7 │ - └─────────────────────────────────────────────────────────────────────────────────────────────────────┘"# - }; - - assert_eq!( - table_with_g1v1_and_type.to_string(), - expected_table_with_g1v1_and_type - ); - - // Test with show_type = true and show_g1v1 = false - let table_with_type = - compute_vault_accounts_table_with_g1v1(&account_tree_nodes, false, true).unwrap(); - - let expected_table_with_type = indoc! {r#" - ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┠- │ SS58 Address Crypto Type Path Name │ - ╞â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡ - │ 5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV sr25519 Mnemonic <Base> Mother │ - │ ├ 5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH //0 Child 1 │ - │ │ ├ 5Fh5PLQNt1xuEXm71dfDtQdnwceSew4oHewWBLsWAkKspV7d //0 Grandchild 1 │ - │ ├ 5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o //1 <Mother//1> │ - │ │ ├ 5CvdJuB9HLXSi5FS9LW57cyHF13iCv5HDimo2C45KxnxriCT //1 <Mother//1//1> │ - │ 5ET2jhgJFoNQUpgfdSkdwftK8DKWdqZ1FKm5GKWdPfMWhPr4 ed25519 G1v1 <Base> MotherG1v1 │ - └─────────────────────────────────────────────────────────────────────────────────────────────────────┘"# - }; - - assert_eq!(table_with_type.to_string(), expected_table_with_type); - } } } diff --git a/src/entities/vault_account.rs b/src/entities/vault_account.rs index 939ee755f5083ef0ad0864caa5676bc965f12b5b..d04b02ad71ce2f1805c7b63a683a28d834d545ad 100644 --- a/src/entities/vault_account.rs +++ b/src/entities/vault_account.rs @@ -40,8 +40,6 @@ pub struct Model { pub encrypted_suri: Option<Vec<u8>>, /// ForeignKey to parent vault_account SS58 Address - None if for a "base" account pub parent: Option<DbAccountId>, - /// Secret format used for the account - Only set for "base" accounts - pub secret_format: Option<DbSecretFormat>, } impl Model { @@ -245,46 +243,6 @@ impl From<DbCryptoScheme> for crate::keys::CryptoScheme { } } -/// Enum for SecretFormat in the database -#[derive(Debug, Copy, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum)] -#[sea_orm( - rs_type = "String", - db_type = "String(StringLen::None)", - enum_name = "secret_format" -)] -pub enum DbSecretFormat { - #[sea_orm(string_value = "seed")] - Seed, - #[sea_orm(string_value = "substrate")] - Substrate, - #[sea_orm(string_value = "predefined")] - Predefined, - #[sea_orm(string_value = "g1v1")] - G1v1, -} - -impl From<crate::keys::SecretFormat> for DbSecretFormat { - fn from(format: crate::keys::SecretFormat) -> Self { - match format { - crate::keys::SecretFormat::Seed => DbSecretFormat::Seed, - crate::keys::SecretFormat::Substrate => DbSecretFormat::Substrate, - crate::keys::SecretFormat::Predefined => DbSecretFormat::Predefined, - crate::keys::SecretFormat::G1v1 => DbSecretFormat::G1v1, - } - } -} - -impl From<DbSecretFormat> for crate::keys::SecretFormat { - fn from(format: DbSecretFormat) -> Self { - match format { - DbSecretFormat::Seed => crate::keys::SecretFormat::Seed, - DbSecretFormat::Substrate => crate::keys::SecretFormat::Substrate, - DbSecretFormat::Predefined => crate::keys::SecretFormat::Predefined, - DbSecretFormat::G1v1 => crate::keys::SecretFormat::G1v1, - } - } -} - #[derive(Copy, Clone, Debug, EnumIter)] pub enum Relation { ParentAccount, @@ -910,7 +868,6 @@ pub async fn create_base_account<C>( name: Option<&String>, crypto_scheme: crate::keys::CryptoScheme, encrypted_suri: Vec<u8>, - secret_format: crate::keys::SecretFormat, ) -> Result<Model, GcliError> where C: ConnectionTrait, @@ -933,7 +890,6 @@ where crypto_scheme: Set(Some(crypto_scheme.into())), encrypted_suri: Set(Some(encrypted_suri)), parent: Default::default(), - secret_format: Set(Some(secret_format.into())), }; vault_account.insert(db).await? } @@ -971,7 +927,6 @@ where crypto_scheme: Set(None), encrypted_suri: Set(None), parent: Set(Some(parent_address.to_string().into())), - secret_format: Set(None), }; vault_account.insert(db).await? } @@ -1028,7 +983,6 @@ pub mod tests { crypto_scheme: None, encrypted_suri: None, parent: Some(child1_address.clone()), - secret_format: None, }, children: vec![], parent: None, @@ -1043,7 +997,6 @@ pub mod tests { crypto_scheme: None, encrypted_suri: None, parent: Some(child2_address.clone()), - secret_format: None, }, children: vec![], parent: None, @@ -1057,7 +1010,6 @@ pub mod tests { crypto_scheme: None, encrypted_suri: None, parent: Some(mother_address.clone()), - secret_format: None, }, children: vec![grandchild1.clone()], parent: None, @@ -1072,7 +1024,6 @@ pub mod tests { crypto_scheme: None, encrypted_suri: None, parent: Some(mother_address.clone()), - secret_format: None, }, children: vec![grandchild2.clone()], parent: None, @@ -1088,7 +1039,6 @@ pub mod tests { vault::encrypt(SUBSTRATE_MNEMONIC.as_bytes(), "".to_string()).unwrap(), ), parent: None, - secret_format: Some(DbSecretFormat::Substrate), }, children: vec![child1.clone(), child2.clone()], parent: None, @@ -1123,7 +1073,6 @@ pub mod tests { vault::encrypt(secret_suri.as_bytes(), "".to_string()).unwrap(), ), parent: None, - secret_format: Some(DbSecretFormat::G1v1), }, children: vec![], parent: None,