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 @@ -129,6 +129,12 @@ impl<'a> InvoiceRequestBuilder<'a> {
129
129
Ok ( self )
130
130
}
131
131
132
+ #[ cfg( test) ]
133
+ pub fn quantity_unchecked ( mut self , quantity : u64 ) -> Self {
134
+ self . invoice_request . quantity = Some ( quantity) ;
135
+ self
136
+ }
137
+
132
138
/// Sets the [`InvoiceRequest::payer_note`].
133
139
///
134
140
/// Successive calls to this method will override the previous setting.
@@ -955,7 +961,7 @@ mod tests {
955
961
. build ( ) . unwrap ( )
956
962
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
957
963
. amount_msats ( 2_000 )
958
- . quantity ( 2 )
964
+ . quantity_unchecked ( 2 )
959
965
. build_unchecked ( )
960
966
. sign ( payer_sign) . unwrap ( ) ;
961
967
@@ -975,7 +981,7 @@ mod tests {
975
981
. build ( ) . unwrap ( )
976
982
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
977
983
. amount_msats ( 10_000 )
978
- . quantity ( 10 )
984
+ . quantity ( 10 ) . unwrap ( )
979
985
. build ( ) . unwrap ( )
980
986
. sign ( payer_sign) . unwrap ( ) ;
981
987
@@ -992,7 +998,7 @@ mod tests {
992
998
. build ( ) . unwrap ( )
993
999
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
994
1000
. amount_msats ( 11_000 )
995
- . quantity ( 11 )
1001
+ . quantity_unchecked ( 11 )
996
1002
. build_unchecked ( )
997
1003
. sign ( payer_sign) . unwrap ( ) ;
998
1004
@@ -1010,7 +1016,7 @@ mod tests {
1010
1016
. build ( ) . unwrap ( )
1011
1017
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
1012
1018
. amount_msats ( 2_000 )
1013
- . quantity ( 2 )
1019
+ . quantity ( 2 ) . unwrap ( )
1014
1020
. build ( ) . unwrap ( )
1015
1021
. sign ( payer_sign) . unwrap ( ) ;
1016
1022
You can’t perform that action at this time.
0 commit comments