Add test of an initial message other than `Init`
[rust-lightning] / lightning / src / offers / parse.rs
index b9815b8117767938bee0ba544f1dd9df73db891f..35c1425acc13b86316858065afb1ed15a7a6402e 100644 (file)
@@ -123,30 +123,56 @@ pub enum ParseError {
 /// Error when interpreting a TLV stream as a specific type.
 #[derive(Debug, PartialEq)]
 pub enum SemanticError {
+       /// The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
+       AlreadyExpired,
        /// The provided chain hash does not correspond to a supported chain.
        UnsupportedChain,
+       /// A chain was provided but was not expected.
+       UnexpectedChain,
        /// An amount was expected but was missing.
        MissingAmount,
        /// The amount exceeded the total bitcoin supply.
        InvalidAmount,
        /// An amount was provided but was not sufficient in value.
        InsufficientAmount,
+       /// An amount was provided but was not expected.
+       UnexpectedAmount,
        /// A currency was provided that is not supported.
        UnsupportedCurrency,
+       /// A feature was required but is unknown.
+       UnknownRequiredFeatures,
+       /// Features were provided but were not expected.
+       UnexpectedFeatures,
        /// A required description was not provided.
        MissingDescription,
        /// A signing pubkey was not provided.
        MissingSigningPubkey,
+       /// A signing pubkey was provided but a different one was expected.
+       InvalidSigningPubkey,
+       /// A signing pubkey was provided but was not expected.
+       UnexpectedSigningPubkey,
        /// A quantity was expected but was missing.
        MissingQuantity,
        /// An unsupported quantity was provided.
        InvalidQuantity,
        /// A quantity or quantity bounds was provided but was not expected.
        UnexpectedQuantity,
+       /// Metadata was provided but was not expected.
+       UnexpectedMetadata,
        /// Payer metadata was expected but was missing.
        MissingPayerMetadata,
        /// A payer id was expected but was missing.
        MissingPayerId,
+       /// Blinded paths were expected but were missing.
+       MissingPaths,
+       /// The blinded payinfo given does not match the number of blinded path hops.
+       InvalidPayInfo,
+       /// An invoice creation time was expected but was missing.
+       MissingCreationTime,
+       /// An invoice payment hash was expected but was missing.
+       MissingPaymentHash,
+       /// A signature was expected but was missing.
+       MissingSignature,
 }
 
 impl From<bech32::Error> for ParseError {