Skip to content

Commit

Permalink
fix(wallet): remove expect statments
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin authored and joshuef committed Oct 4, 2023
1 parent eb0c2ce commit 89ef8e2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sn_client/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ pub async fn send(
let new_cash_note = wallet_client
.send_cash_note(amount, to, verify_store)
.await
.expect("Nanos shall be successfully sent.");
.map_err(|err| {
error!("Could not send cash note, err: {err:?}");
err
})?;

let mut did_error = false;
if verify_store {
Expand All @@ -388,12 +391,8 @@ pub async fn send(
}

let mut wallet = wallet_client.into_wallet();
wallet
.store()
.expect("Wallet shall be successfully stored.");
wallet
.store_cash_note(&new_cash_note)
.expect("Created cash_note shall be successfully stored.");
wallet.store()?;
wallet.store_cash_note(&new_cash_note)?;

if did_error {
return Err(WalletError::UnconfirmedTxAfterRetries);
Expand Down

0 comments on commit 89ef8e2

Please sign in to comment.