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 @@ -137,6 +137,12 @@ impl<'a> InvoiceRequestBuilder<'a> {
137
137
Ok ( self )
138
138
}
139
139
140
+ #[ cfg( test) ]
141
+ pub fn quantity_unchecked ( mut self , quantity : u64 ) -> Self {
142
+ self . invoice_request . quantity = Some ( quantity) ;
143
+ self
144
+ }
145
+
140
146
/// Sets the [`InvoiceRequest::payer_note`].
141
147
///
142
148
/// Successive calls to this method will override the previous setting.
@@ -948,7 +954,7 @@ mod tests {
948
954
. build ( ) . unwrap ( )
949
955
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
950
956
. amount_msats ( 2_000 )
951
- . quantity ( 2 )
957
+ . quantity_unchecked ( 2 )
952
958
. build_unchecked ( )
953
959
. sign ( payer_sign) . unwrap ( ) ;
954
960
@@ -968,7 +974,7 @@ mod tests {
968
974
. build ( ) . unwrap ( )
969
975
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
970
976
. amount_msats ( 10_000 )
971
- . quantity ( 10 )
977
+ . quantity ( 10 ) . unwrap ( )
972
978
. build ( ) . unwrap ( )
973
979
. sign ( payer_sign) . unwrap ( ) ;
974
980
@@ -985,7 +991,7 @@ mod tests {
985
991
. build ( ) . unwrap ( )
986
992
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
987
993
. amount_msats ( 11_000 )
988
- . quantity ( 11 )
994
+ . quantity_unchecked ( 11 )
989
995
. build_unchecked ( )
990
996
. sign ( payer_sign) . unwrap ( ) ;
991
997
@@ -1003,7 +1009,7 @@ mod tests {
1003
1009
. build ( ) . unwrap ( )
1004
1010
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1005
1011
. amount_msats ( 2_000 )
1006
- . quantity ( 2 )
1012
+ . quantity ( 2 ) . unwrap ( )
1007
1013
. build ( ) . unwrap ( )
1008
1014
. sign ( payer_sign) . unwrap ( ) ;
1009
1015
You can’t perform that action at this time.
0 commit comments