We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 877a2f4 commit 75a361cCopy full SHA for 75a361c
lightning/src/offers/offer.rs
@@ -876,6 +876,18 @@ mod tests {
876
Ok(_) => panic!("expected error"),
877
Err(e) => assert_eq!(e, ParseError::InvalidSemantics(SemanticError::MissingAmount)),
878
}
879
+
880
+ let mut tlv_stream = offer.as_tlv_stream();
881
+ tlv_stream.amount = Some(MAX_VALUE_MSAT + 1);
882
+ tlv_stream.currency = None;
883
884
+ let mut encoded_offer = Vec::new();
885
+ tlv_stream.write(&mut encoded_offer).unwrap();
886
887
+ match Offer::try_from(encoded_offer) {
888
+ Ok(_) => panic!("expected error"),
889
+ Err(e) => assert_eq!(e, ParseError::InvalidSemantics(SemanticError::InvalidAmount)),
890
+ }
891
892
893
#[test]
0 commit comments