Skip to content

Commit

Permalink
minor changes to error
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Dec 10, 2024
1 parent 583de6a commit 00e7148
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mm2src/coins/z_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl ZCoin {
// and saving them to the wallet database for future spends
store_change_output(self.consensus_params_ref(), &self.z_fields.light_wallet_db, &tx)
.await
.mm_err(GenTxError::SaveChangeNotesError)?;
.map_to_mm(GenTxError::SaveChangeNotesError)?;

let additional_data = AdditionalTxData {
received_by_me,
Expand Down
9 changes: 3 additions & 6 deletions mm2src/coins/z_coin/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub use blockdb::*;

pub mod walletdb;
#[cfg(target_arch = "wasm32")] mod z_params;
use mm2_err_handle::prelude::MapToMmResult;
#[cfg(target_arch = "wasm32")]
pub(crate) use z_params::ZcashParamsWasmImpl;

Expand Down Expand Up @@ -202,11 +201,9 @@ pub(crate) async fn store_change_output(
params: &ZcoinConsensusParams,
shared_db: &WalletDbShared,
tx: &Transaction,
) -> MmResult<(), String> {
let mut data = shared_db.db.get_update_ops().map_to_mm(|err| err.to_string())?;
decrypt_and_store_transaction(params, &mut data, tx)
.await
.map_to_mm(|err| err.to_string())?;
) -> Result<(), String> {
let mut data = try_s!(shared_db.db.get_update_ops());
try_s!(decrypt_and_store_transaction(params, &mut data, tx).await);

Ok(())
}
2 changes: 1 addition & 1 deletion mm2src/coins/z_coin/z_htlc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub async fn z_p2sh_spend(
// and saving them to the wallet database for future spends
store_change_output(coin.consensus_params_ref(), &coin.z_fields.light_wallet_db, &zcash_tx)
.await
.mm_err(|err| ZP2SHSpendError::GenTxError(GenTxError::SaveChangeNotesError(err)))?;
.map_to_mm(|err| ZP2SHSpendError::GenTxError(GenTxError::SaveChangeNotesError(err)))?;

coin.utxo_rpc_client()
.send_raw_transaction(tx_buffer.into())
Expand Down

0 comments on commit 00e7148

Please sign in to comment.