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.
@@ -918,7 +924,7 @@ mod tests {
918
924
. build ( ) . unwrap ( )
919
925
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
920
926
. amount_msats ( 2_000 )
921
- . quantity ( 2 )
927
+ . quantity_unchecked ( 2 )
922
928
. build_unchecked ( )
923
929
. sign ( payer_sign) . unwrap ( ) ;
924
930
@@ -938,7 +944,7 @@ mod tests {
938
944
. build ( ) . unwrap ( )
939
945
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
940
946
. amount_msats ( 10_000 )
941
- . quantity ( 10 )
947
+ . quantity ( 10 ) . unwrap ( )
942
948
. build ( ) . unwrap ( )
943
949
. sign ( payer_sign) . unwrap ( ) ;
944
950
@@ -955,7 +961,7 @@ mod tests {
955
961
. build ( ) . unwrap ( )
956
962
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
957
963
. amount_msats ( 11_000 )
958
- . quantity ( 11 )
964
+ . quantity_unchecked ( 11 )
959
965
. build_unchecked ( )
960
966
. sign ( payer_sign) . unwrap ( ) ;
961
967
@@ -973,7 +979,7 @@ mod tests {
973
979
. build ( ) . unwrap ( )
974
980
. request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) )
975
981
. amount_msats ( 2_000 )
976
- . quantity ( 2 )
982
+ . quantity ( 2 ) . unwrap ( )
977
983
. build ( ) . unwrap ( )
978
984
. sign ( payer_sign) . unwrap ( ) ;
979
985
You can’t perform that action at this time.
0 commit comments