Skip to content

Commit c389dce

Browse files
committed
Allow fails_with_partial_failure to define results
1 parent e0592c2 commit c389dce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning-invoice/src/payment.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ mod tests {
810810
use std::time::{SystemTime, Duration};
811811
use time_utils::tests::SinceEpoch;
812812
use DEFAULT_EXPIRY_TIME;
813+
use lightning::util::errors::APIError::{ChannelUnavailable, MonitorUpdateFailed};
813814

814815
fn invoice(payment_preimage: PaymentPreimage) -> Invoice {
815816
let payment_hash = Sha256::hash(&payment_preimage.0);
@@ -1919,9 +1920,9 @@ mod tests {
19191920
self.fails_with(failure, OnAttempt(attempt))
19201921
}
19211922

1922-
fn fails_with_partial_failure(self, retry: RouteParameters, attempt: OnAttempt) -> Self {
1923+
fn fails_with_partial_failure(self, retry: RouteParameters, attempt: OnAttempt, results: Option<Vec<Result<(), APIError>>>) -> Self {
19231924
self.fails_with(PaymentSendFailure::PartialFailure {
1924-
results: vec![],
1925+
results: results.unwrap_or(vec![]),
19251926
failed_paths_retry: Some(retry),
19261927
payment_id: PaymentId([1; 32]),
19271928
}, attempt)

0 commit comments

Comments
 (0)