Use explicit import lists instead of glob imports in invoice
[rust-lightning] / lightning-invoice / src / de.rs
index 52a2201bdfd4c16eefb4e4d51d5d9ae0730a812a..3610bc4b67fab01f11283aed957c1fe71ccb4731 100644 (file)
@@ -10,6 +10,7 @@ use bech32::{u5, FromBase32};
 
 use bitcoin_hashes::Hash;
 use bitcoin_hashes::sha256;
+use lightning::ln::PaymentSecret;
 use lightning::routing::network_graph::RoutingFees;
 use lightning::routing::router::RouteHintHop;
 
@@ -19,7 +20,9 @@ use secp256k1;
 use secp256k1::recovery::{RecoveryId, RecoverableSignature};
 use secp256k1::key::PublicKey;
 
-use super::*;
+use super::{Invoice, Sha256, TaggedField, ExpiryTime, MinFinalCltvExpiry, Fallback, PayeePubKey, InvoiceSignature, PositiveTimestamp,
+       SemanticError, RouteHint, Description, RawTaggedField, Currency, RawHrp, SiPrefix, RawInvoice, constants, SignedRawInvoice,
+       RawDataPart, CreationError, InvoiceFeatures};
 
 use self::hrp_sm::parse_hrp;
 
@@ -484,21 +487,6 @@ impl FromBase32 for PayeePubKey {
        }
 }
 
-impl FromBase32 for PaymentSecret {
-       type Err = ParseError;
-
-       fn from_base32(field_data: &[u5]) -> Result<PaymentSecret, ParseError> {
-               if field_data.len() != 52 {
-                       Err(ParseError::Skip)
-               } else {
-                       let data_bytes = Vec::<u8>::from_base32(field_data)?;
-                       let mut payment_secret = [0; 32];
-                       payment_secret.copy_from_slice(&data_bytes);
-                       Ok(PaymentSecret(payment_secret))
-               }
-       }
-}
-
 impl FromBase32 for ExpiryTime {
        type Err = ParseError;