浏览代码

update lnbits-rs to 0.5.0

Darrell 2 周之前
父节点
当前提交
bac711d9fd
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 1 1
      crates/cdk-lnbits/Cargo.toml
  2. 4 1
      crates/cdk-lnbits/src/lib.rs

+ 1 - 1
crates/cdk-lnbits/Cargo.toml

@@ -21,5 +21,5 @@ tokio.workspace = true
 tokio-util.workspace = true
 tokio-util.workspace = true
 tracing.workspace = true
 tracing.workspace = true
 thiserror.workspace = true
 thiserror.workspace = true
-lnbits-rs = "0.4.0"
+lnbits-rs = "0.5.0"
 serde_json.workspace = true
 serde_json.workspace = true

+ 4 - 1
crates/cdk-lnbits/src/lib.rs

@@ -276,7 +276,10 @@ impl MintPayment for LNbits {
                 Self::Err::Anyhow(anyhow!("Could not create invoice"))
                 Self::Err::Anyhow(anyhow!("Could not create invoice"))
             })?;
             })?;
 
 
-        let request: Bolt11Invoice = create_invoice_response.payment_request.parse()?;
+        let request: Bolt11Invoice = create_invoice_response
+            .bolt11()
+            .ok_or_else(|| Self::Err::Anyhow(anyhow!("Missing bolt11 invoice")))?
+            .parse()?;
         let expiry = request.expires_at().map(|t| t.as_secs());
         let expiry = request.expires_at().map(|t| t.as_secs());
 
 
         Ok(CreateIncomingPaymentResponse {
         Ok(CreateIncomingPaymentResponse {