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

Fixes after rebase of modified upstream branch

* Fix for display.rs compute_vault_account_json that should not include wallet_type anymore (was removed from upstream branch)
* Also some changes from `cargo fmt`
parent 2843da7b
No related branches found
No related tags found
No related merge requests found
...@@ -155,8 +155,6 @@ pub fn compute_vault_accounts_row_with_g1v1( ...@@ -155,8 +155,6 @@ pub fn compute_vault_accounts_row_with_g1v1(
pub struct VaultAccountView { pub struct VaultAccountView {
address: String, address: String,
crypto_scheme: Option<String>, crypto_scheme: Option<String>,
//FIXME remove wallet_type
wallet_type: Option<String>,
path: String, path: String,
name: String, name: String,
g1v1_public_key: Option<String>, g1v1_public_key: Option<String>,
...@@ -187,14 +185,17 @@ fn compute_vault_account_json( ...@@ -187,14 +185,17 @@ fn compute_vault_account_json(
let name = if let Some(name) = borrowed_node.account.name.clone() { let name = if let Some(name) = borrowed_node.account.name.clone() {
name name
} else if let Some(computed_name) = vault_account::compute_name_account_tree_node(account_tree_node) { } else if let Some(computed_name) =
vault_account::compute_name_account_tree_node(account_tree_node)
{
format!("<{}>", computed_name) format!("<{}>", computed_name)
} else { } else {
empty_string.clone() empty_string.clone()
}; };
let (path, crypto_scheme, wallet_type, g1v1_public_key) = if let Some(path) = borrowed_node.account.path.clone() { let (path, crypto_scheme, g1v1_public_key) =
(path, None, None, None) if let Some(path) = borrowed_node.account.path.clone() {
(path, None, None)
} else { } else {
let crypto_scheme = borrowed_node.account.crypto_scheme.map(|cs| { let crypto_scheme = borrowed_node.account.crypto_scheme.map(|cs| {
let scheme = CryptoScheme::from(cs); let scheme = CryptoScheme::from(cs);
...@@ -202,22 +203,19 @@ fn compute_vault_account_json( ...@@ -202,22 +203,19 @@ fn compute_vault_account_json(
scheme_str.to_string() scheme_str.to_string()
}); });
let wallet_type = borrowed_node.account.secret_format.map(|sf| {
match crate::keys::SecretFormat::from(sf) {
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(),
}
});
let g1v1_public_key = if show_g1v1 && crypto_scheme.as_deref() == Some("ed25519") { let g1v1_public_key = if show_g1v1 && crypto_scheme.as_deref() == Some("ed25519") {
Some(cesium::compute_g1v1_public_key_from_ed25519_account_id(&borrowed_node.account.address.0)) Some(cesium::compute_g1v1_public_key_from_ed25519_account_id(
&borrowed_node.account.address.0,
))
} else { } else {
None None
}; };
(format!("<{}>", borrowed_node.account.account_type()), crypto_scheme, wallet_type, g1v1_public_key) (
format!("<{}>", borrowed_node.account.account_type()),
crypto_scheme,
g1v1_public_key,
)
}; };
let mut children = Vec::new(); let mut children = Vec::new();
...@@ -228,7 +226,6 @@ fn compute_vault_account_json( ...@@ -228,7 +226,6 @@ fn compute_vault_account_json(
VaultAccountView { VaultAccountView {
address: borrowed_node.account.address.to_string(), address: borrowed_node.account.address.to_string(),
crypto_scheme, crypto_scheme,
wallet_type,
path, path,
name, name,
g1v1_public_key, g1v1_public_key,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment