@@ -16,9 +16,9 @@ use crate::ln::channelmanager::RecipientOnionFields;
16
16
use crate :: routing:: router:: { PaymentParameters , RouteParameters } ;
17
17
use crate :: types:: payment:: PaymentHash ;
18
18
19
- /// Builds the necessary parameters to pay or pre-flight probe the given zero -amount
20
- /// [`Bolt11Invoice`] using [`ChannelManager::send_payment `] or
21
- /// [`ChannelManager::send_preflight_probes`].
19
+ /// Builds the necessary parameters to pay or pre-flight probe the given variable -amount
20
+ /// (also known as 'zero-amount') [`Bolt11Invoice `] using
21
+ /// [`ChannelManager::send_payment`] or [`ChannelManager:: send_preflight_probes`].
22
22
///
23
23
/// Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
24
24
/// same [`PaymentHash`] has never been paid before.
@@ -28,7 +28,7 @@ use crate::types::payment::PaymentHash;
28
28
///
29
29
/// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
30
30
/// [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes
31
- pub fn payment_parameters_from_zero_amount_invoice (
31
+ pub fn payment_parameters_from_variable_amount_invoice (
32
32
invoice : & Bolt11Invoice , amount_msat : u64 ,
33
33
) -> Result < ( PaymentHash , RecipientOnionFields , RouteParameters ) , ( ) > {
34
34
if invoice. amount_milli_satoshis ( ) . is_some ( ) {
@@ -45,7 +45,7 @@ pub fn payment_parameters_from_zero_amount_invoice(
45
45
/// same [`PaymentHash`] has never been paid before.
46
46
///
47
47
/// Will always succeed unless the invoice has no amount specified, in which case
48
- /// [`payment_parameters_from_zero_amount_invoice `] should be used.
48
+ /// [`payment_parameters_from_variable_amount_invoice `] should be used.
49
49
///
50
50
/// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
51
51
/// [`ChannelManager::send_preflight_probes`]: crate::ln::channelmanager::ChannelManager::send_preflight_probes
@@ -112,7 +112,7 @@ mod tests {
112
112
. build_signed ( |hash| secp_ctx. sign_ecdsa_recoverable ( hash, & private_key) )
113
113
. unwrap ( ) ;
114
114
115
- assert ! ( payment_parameters_from_zero_amount_invoice ( & invoice, 42 ) . is_err( ) ) ;
115
+ assert ! ( payment_parameters_from_variable_amount_invoice ( & invoice, 42 ) . is_err( ) ) ;
116
116
117
117
let ( hash, onion, params) = payment_parameters_from_invoice ( & invoice) . unwrap ( ) ;
118
118
assert_eq ! ( & hash. 0 [ ..] , & payment_hash[ ..] ) ;
@@ -146,7 +146,7 @@ mod tests {
146
146
assert ! ( payment_parameters_from_invoice( & invoice) . is_err( ) ) ;
147
147
148
148
let ( hash, onion, params) =
149
- payment_parameters_from_zero_amount_invoice ( & invoice, 42 ) . unwrap ( ) ;
149
+ payment_parameters_from_variable_amount_invoice ( & invoice, 42 ) . unwrap ( ) ;
150
150
assert_eq ! ( & hash. 0 [ ..] , & payment_hash[ ..] ) ;
151
151
assert_eq ! ( onion. payment_secret, Some ( PaymentSecret ( [ 0 ; 32 ] ) ) ) ;
152
152
assert_eq ! ( params. final_value_msat, 42 ) ;
0 commit comments