@@ -23,8 +23,8 @@ use secp256k1::recovery::{RecoveryId, RecoverableSignature};
23
23
use secp256k1:: key:: PublicKey ;
24
24
25
25
use super :: { Invoice , Sha256 , TaggedField , ExpiryTime , MinFinalCltvExpiry , Fallback , PayeePubKey , InvoiceSignature , PositiveTimestamp ,
26
- SemanticError , PrivateRoute , Description , RawTaggedField , Currency , RawHrp , SiPrefix , RawInvoice , constants , SignedRawInvoice ,
27
- RawDataPart , InvoiceFeatures } ;
26
+ SemanticError , PrivateRoute , ParseError , ParseOrSemanticError , Description , RawTaggedField , Currency , RawHrp , SiPrefix , RawInvoice ,
27
+ constants , SignedRawInvoice , RawDataPart , InvoiceFeatures } ;
28
28
29
29
use self :: hrp_sm:: parse_hrp;
30
30
@@ -619,46 +619,6 @@ impl FromBase32 for PrivateRoute {
619
619
}
620
620
}
621
621
622
- /// Errors that indicate what is wrong with the invoice. They have some granularity for debug
623
- /// reasons, but should generally result in an "invalid BOLT11 invoice" message for the user.
624
- #[ allow( missing_docs) ]
625
- #[ derive( PartialEq , Debug , Clone ) ]
626
- pub enum ParseError {
627
- Bech32Error ( bech32:: Error ) ,
628
- ParseAmountError ( ParseIntError ) ,
629
- MalformedSignature ( secp256k1:: Error ) ,
630
- BadPrefix ,
631
- UnknownCurrency ,
632
- UnknownSiPrefix ,
633
- MalformedHRP ,
634
- TooShortDataPart ,
635
- UnexpectedEndOfTaggedFields ,
636
- DescriptionDecodeError ( str:: Utf8Error ) ,
637
- PaddingError ,
638
- IntegerOverflowError ,
639
- InvalidSegWitProgramLength ,
640
- InvalidPubKeyHashLength ,
641
- InvalidScriptHashLength ,
642
- InvalidRecoveryId ,
643
- InvalidSliceLength ( String ) ,
644
-
645
- /// Not an error, but used internally to signal that a part of the invoice should be ignored
646
- /// according to BOLT11
647
- Skip ,
648
- }
649
-
650
- /// Indicates that something went wrong while parsing or validating the invoice. Parsing errors
651
- /// should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
652
- /// like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
653
- #[ derive( PartialEq , Debug , Clone ) ]
654
- pub enum ParseOrSemanticError {
655
- /// The invoice couldn't be decoded
656
- ParseError ( ParseError ) ,
657
-
658
- /// The invoice could be decoded but violates the BOLT11 standard
659
- SemanticError ( :: SemanticError ) ,
660
- }
661
-
662
622
impl Display for ParseError {
663
623
fn fmt ( & self , f : & mut Formatter ) -> fmt:: Result {
664
624
match * self {
0 commit comments