X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-invoice%2Fsrc%2Flib.rs;h=dd86c06f23f80d524f860aca5bc3c9355962c099;hb=refs%2Fheads%2F2021-12-0.0.104-bindings;hp=3492b74f42371803e2dd6c10fa06cce1d94804d3;hpb=d9b9916601cf688dabb0ad4dcddcb98c4c8467e5;p=rust-lightning diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 3492b74f..dd86c06f 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -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"), } } }