Prechádzať zdrojové kódy

chore: remove unwraps lnd

thesimplekid 1 mesiac pred
rodič
commit
cbc43b5db5

+ 2 - 3
crates/cdk-lnd/src/lib.rs

@@ -104,8 +104,7 @@ impl Lnd {
             .map_err(|err| {
                 tracing::error!("Connection error: {}", err.to_string());
                 Error::Connection
-            })
-            .unwrap();
+            })?;
 
         Ok(Self {
             _address: address,
@@ -636,7 +635,7 @@ impl MintPayment for Lnd {
         let mut lnd_client = self.lnd_client.clone();
 
         let invoice_request = lnrpc::PaymentHash {
-            r_hash: hex::decode(payment_identifier.to_string()).unwrap(),
+            r_hash: hex::decode(payment_identifier.to_string())?,
             ..Default::default()
         };
 

+ 1 - 1
crates/cdk/src/mint/issue/mod.rs

@@ -654,7 +654,7 @@ impl Mint {
             }
         }
 
-        let unit = unit.ok_or(Error::UnsupportedUnit).unwrap();
+        let unit = unit.ok_or(Error::UnsupportedUnit)?;
         ensure_cdk!(unit == mint_quote.unit, Error::UnsupportedUnit);
 
         let operation = Operation::new_mint();