File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,12 @@ impl<'a> InvoiceRequestBuilder<'a> {
139
139
Ok ( self )
140
140
}
141
141
142
+ #[ cfg( test) ]
143
+ pub fn quantity_unchecked ( mut self , quantity : u64 ) -> Self {
144
+ self . invoice_request . quantity = Some ( quantity) ;
145
+ self
146
+ }
147
+
142
148
/// Sets the [`InvoiceRequest::payer_note`].
143
149
///
144
150
/// Successive calls to this method will override the previous setting.
@@ -1032,7 +1038,7 @@ mod tests {
1032
1038
. build ( ) . unwrap ( )
1033
1039
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1034
1040
. amount_msats ( 2_000 )
1035
- . quantity ( 2 )
1041
+ . quantity_unchecked ( 2 )
1036
1042
. build_unchecked ( )
1037
1043
. sign ( payer_sign) . unwrap ( ) ;
1038
1044
@@ -1052,7 +1058,7 @@ mod tests {
1052
1058
. build ( ) . unwrap ( )
1053
1059
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1054
1060
. amount_msats ( 10_000 )
1055
- . quantity ( 10 )
1061
+ . quantity ( 10 ) . unwrap ( )
1056
1062
. build ( ) . unwrap ( )
1057
1063
. sign ( payer_sign) . unwrap ( ) ;
1058
1064
@@ -1069,7 +1075,7 @@ mod tests {
1069
1075
. build ( ) . unwrap ( )
1070
1076
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1071
1077
. amount_msats ( 11_000 )
1072
- . quantity ( 11 )
1078
+ . quantity_unchecked ( 11 )
1073
1079
. build_unchecked ( )
1074
1080
. sign ( payer_sign) . unwrap ( ) ;
1075
1081
@@ -1087,7 +1093,7 @@ mod tests {
1087
1093
. build ( ) . unwrap ( )
1088
1094
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1089
1095
. amount_msats ( 2_000 )
1090
- . quantity ( 2 )
1096
+ . quantity ( 2 ) . unwrap ( )
1091
1097
. build ( ) . unwrap ( )
1092
1098
. sign ( payer_sign) . unwrap ( ) ;
1093
1099
You can’t perform that action at this time.
0 commit comments