Skip to content

Commit

Permalink
Allow wallet type from db
Browse files Browse the repository at this point in the history
- Allow wallet type from the wallet database to have preference. This will allow old wallets
without wallet type fields to be accepted as software wallets when added to the config file.
- Set `newline_style = "Auto"` as we do not use JavaScript cucumber anymore; this was an issue
  on Windows.
  • Loading branch information
hansieodendaal committed Apr 2, 2024
1 parent 5380e1f commit a67f7ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/minotari_ledger_wallet/rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ imports_layout = "HorizontalVertical"
imports_granularity = "Crate"
match_block_trailing_comma = true
max_width = 120
newline_style = "Native"
newline_style = "Auto"
normalize_comments = true
overflow_delimited_expr = true
reorder_imports = true
Expand Down
3 changes: 1 addition & 2 deletions base_layer/wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,12 +774,11 @@ pub fn read_or_create_wallet_type<T: WalletBackend + 'static>(
(None, None) => {
panic!("Something is very wrong, no wallet type was found in the DB, or provided (on first run)")
},
(Some(_), Some(_)) => panic!("Something is very wrong we have a wallet type from the DB and on first run"),
(None, Some(t)) => {
db.set_wallet_type(t)?;
Ok(t)
},
(Some(t), None) => Ok(t),
(Some(t), _) => Ok(t),
}
}

Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ imports_layout = "HorizontalVertical"
imports_granularity = "Crate"
match_block_trailing_comma = true
max_width = 120
newline_style = "Native"
newline_style = "Auto"
normalize_comments = true
overflow_delimited_expr = true
reorder_imports = true
Expand Down

0 comments on commit a67f7ee

Please sign in to comment.