Merge pull request #1219 from TheBlueMatt/2021-12-0.0.104-bindings
[rust-lightning] / lightning-invoice / src / lib.rs
index 3492b74f42371803e2dd6c10fa06cce1d94804d3..dd86c06f23f80d524f860aca5bc3c9355962c099 100644 (file)
@@ -379,7 +379,8 @@ pub enum TaggedField {
 
 /// SHA-256 hash
 #[derive(Clone, Debug, Hash, Eq, PartialEq)]
-pub struct Sha256(pub sha256::Hash);
+pub struct Sha256(/// (C-not exported) as the native hash types are not currently mapped
+       pub sha256::Hash);
 
 /// Description string
 ///
@@ -1412,6 +1413,9 @@ pub enum CreationError {
 
        /// The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
        ExpiryTimeOutOfBounds,
+
+       /// The supplied millisatoshi amount was greater than the total bitcoin supply.
+       InvalidAmount,
 }
 
 impl Display for CreationError {
@@ -1421,6 +1425,7 @@ impl Display for CreationError {
                        CreationError::RouteTooLong => f.write_str("The specified route has too many hops and can't be encoded"),
                        CreationError::TimestampOutOfBounds => f.write_str("The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime`"),
                        CreationError::ExpiryTimeOutOfBounds => f.write_str("The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`"),
+                       CreationError::InvalidAmount => f.write_str("The supplied millisatoshi amount was greater than the total bitcoin supply"),
                }
        }
 }