Skip to content

Commit

Permalink
Merge pull request lightningdevkit#3079 from jkczyz/2024-05-expects-q…
Browse files Browse the repository at this point in the history
…uantity

Add missing `Offer::expects_quantity` to tests
  • Loading branch information
tnull authored May 23, 2024
2 parents a95338a + 7ceb709 commit 1d421d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lightning/src/offers/offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ mod tests {
assert_eq!(offer.paths(), &[]);
assert_eq!(offer.issuer(), None);
assert_eq!(offer.supported_quantity(), Quantity::One);
assert!(!offer.expects_quantity());
assert_eq!(offer.signing_pubkey(), Some(pubkey(42)));

assert_eq!(
Expand Down Expand Up @@ -1548,6 +1549,7 @@ mod tests {
.build()
.unwrap();
let tlv_stream = offer.as_tlv_stream();
assert!(!offer.expects_quantity());
assert_eq!(offer.supported_quantity(), Quantity::One);
assert_eq!(tlv_stream.quantity_max, None);

Expand All @@ -1556,6 +1558,7 @@ mod tests {
.build()
.unwrap();
let tlv_stream = offer.as_tlv_stream();
assert!(offer.expects_quantity());
assert_eq!(offer.supported_quantity(), Quantity::Unbounded);
assert_eq!(tlv_stream.quantity_max, Some(0));

Expand All @@ -1564,6 +1567,7 @@ mod tests {
.build()
.unwrap();
let tlv_stream = offer.as_tlv_stream();
assert!(offer.expects_quantity());
assert_eq!(offer.supported_quantity(), Quantity::Bounded(ten));
assert_eq!(tlv_stream.quantity_max, Some(10));

Expand All @@ -1572,6 +1576,7 @@ mod tests {
.build()
.unwrap();
let tlv_stream = offer.as_tlv_stream();
assert!(offer.expects_quantity());
assert_eq!(offer.supported_quantity(), Quantity::Bounded(one));
assert_eq!(tlv_stream.quantity_max, Some(1));

Expand All @@ -1581,6 +1586,7 @@ mod tests {
.build()
.unwrap();
let tlv_stream = offer.as_tlv_stream();
assert!(!offer.expects_quantity());
assert_eq!(offer.supported_quantity(), Quantity::One);
assert_eq!(tlv_stream.quantity_max, None);
}
Expand Down

0 comments on commit 1d421d3

Please sign in to comment.