We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5add3d6 commit 9eeccb2Copy full SHA for 9eeccb2
lightning/src/offers/offer.rs
@@ -957,6 +957,19 @@ mod tests {
957
if let Err(e) = offer.to_string().parse::<Offer>() {
958
panic!("error parsing offer: {:?}", e);
959
}
960
+
961
+ let mut tlv_stream = offer.as_tlv_stream();
962
+ tlv_stream.quantity_max = Some(1);
963
964
+ let mut encoded_offer = Vec::new();
965
+ tlv_stream.write(&mut encoded_offer).unwrap();
966
967
+ match Offer::try_from(encoded_offer) {
968
+ Ok(_) => panic!("expected error"),
969
+ Err(e) => {
970
+ assert_eq!(e, ParseError::InvalidSemantics(SemanticError::InvalidQuantity));
971
+ },
972
+ }
973
974
975
#[test]
0 commit comments