Skip to content
Snippets Groups Projects

Draft: Resolve "Error: Base 58 requirement is violated"

Open Nicolas80 requested to merge 48-error-base-58-requirement-is-violated into master
1 unresolved thread
Files
2
+ 4
3
@@ -729,7 +729,7 @@ where
println!();
let vault_account = if let Some(existing_vault_account) =
vault_account::find_by_id(db_tx, &DbAccountId::from(address_to_import.clone())).await?
vault_account::find_by_id(db_tx, &DbAccountId::try_from(address_to_import.clone())?).await?
{
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.");
@@ -853,7 +853,8 @@ where
println!("Trying to create derivation with address '{derivation_address}'");
println!();
let vault_account = if let Some(existing_vault_account) =
vault_account::find_by_id(db_tx, &DbAccountId::from(derivation_address.clone())).await?
vault_account::find_by_id(db_tx, &DbAccountId::try_from(derivation_address.clone())?)
.await?
{
// Existing account
println!("You are trying to derive '{derivation_path}' from parent '{parent_address}'");
@@ -922,7 +923,7 @@ where
// Since links are made based on address / parent(address) we can just edit the existing entry and it should be fine
let mut vault_account: ActiveModel = existing_vault_account.into();
vault_account.path = Set(Some(derivation_path.clone()));
vault_account.parent = Set(Some(DbAccountId::from(parent_address.clone())));
vault_account.parent = Set(Some(DbAccountId::try_from(parent_address.clone())?));
vault_account.crypto_scheme = Set(None);
vault_account.encrypted_suri = Set(None);
vault_account.name = Set(name.clone());
Loading