File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ mod tests {
466
466
#[ cfg( feature = "std" ) ]
467
467
use core:: time:: Duration ;
468
468
use crate :: ln:: features:: InvoiceRequestFeatures ;
469
- use crate :: ln:: msgs:: DecodeError ;
469
+ use crate :: ln:: msgs:: { DecodeError , MAX_VALUE_MSAT } ;
470
470
use crate :: offers:: offer:: { OfferBuilder , Quantity } ;
471
471
use crate :: offers:: parse:: { ParseError , SemanticError } ;
472
472
use crate :: util:: ser:: { BigSize , Writeable } ;
@@ -704,6 +704,16 @@ mod tests {
704
704
Err ( e) => assert_eq ! ( e, SemanticError :: InsufficientAmount ) ,
705
705
}
706
706
707
+ match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
708
+ . amount_msats ( 1000 )
709
+ . build ( ) . unwrap ( )
710
+ . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
711
+ . amount_msats ( MAX_VALUE_MSAT + 1 )
712
+ {
713
+ Ok ( _) => panic ! ( "expected error" ) ,
714
+ Err ( e) => assert_eq ! ( e, SemanticError :: InvalidAmount ) ,
715
+ }
716
+
707
717
match OfferBuilder :: new ( "foo" . into ( ) , recipient_pubkey ( ) )
708
718
. amount_msats ( 1000 )
709
719
. supported_quantity ( Quantity :: Unbounded )
You can’t perform that action at this time.
0 commit comments