From 3446201b6802e6551d8d9140bb100990dd5bee58 Mon Sep 17 00:00:00 2001 From: elnosh Date: Mon, 12 Feb 2024 18:47:05 +0000 Subject: [PATCH] refetch invoice --- mutiny-core/src/lib.rs | 3 ++- mutiny-wasm/src/error.rs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mutiny-core/src/lib.rs b/mutiny-core/src/lib.rs index b19f15c29..d4992d37d 100644 --- a/mutiny-core/src/lib.rs +++ b/mutiny-core/src/lib.rs @@ -2209,7 +2209,7 @@ impl MutinyWallet { let invoice_amount = token.proofs.total_amount() as f64 * (1.0 - 3.0 / 100.0); - let mutiny_invoice = self + let mut mutiny_invoice = self .create_invoice(invoice_amount as u64, vec!["Cashu Token Melt".to_string()]) .await?; @@ -2231,6 +2231,7 @@ impl MutinyWallet { .await?; if post_melt_bolt11_response.paid { + mutiny_invoice = self.get_invoice(&mutiny_invoice_str).await?; invoices.push(mutiny_invoice); } } diff --git a/mutiny-wasm/src/error.rs b/mutiny-wasm/src/error.rs index 9854231aa..1f5dbeecb 100644 --- a/mutiny-wasm/src/error.rs +++ b/mutiny-wasm/src/error.rs @@ -1,7 +1,6 @@ use bitcoin::Network; use lightning_invoice::ParseOrSemanticError; use log::error; -use moksha_core::error::MokshaCoreError; use mutiny_core::error::{MutinyError, MutinyStorageError}; use thiserror::Error; use wasm_bindgen::JsValue; @@ -302,7 +301,7 @@ impl From for MutinyJsError { impl From for MutinyJsError { fn from(e: moksha_core::error::MokshaCoreError) -> Self { - MokshaCoreError::from(e).into() + e.into() } }