From 4da6f23cfff84467aa0de2fa36ee6300f89b5055 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 26 Jul 2022 20:31:17 +0000 Subject: [PATCH] Drop unused test code in `lightning-invoice::payment` --- lightning-invoice/src/payment.rs | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index 051893ea0..476d12a34 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -1437,8 +1437,6 @@ mod tests { enum TestResult { PaymentFailure { path: Vec, short_channel_id: u64 }, PaymentSuccess { path: Vec }, - ProbeFailure { path: Vec, short_channel_id: u64 }, - ProbeSuccess { path: Vec }, } impl TestScorer { @@ -1474,12 +1472,6 @@ mod tests { Some(TestResult::PaymentSuccess { path }) => { panic!("Unexpected successful payment path: {:?}", path) }, - Some(TestResult::ProbeFailure { path, .. }) => { - panic!("Unexpected failed payment probe: {:?}", path) - }, - Some(TestResult::ProbeSuccess { path }) => { - panic!("Unexpected successful payment probe: {:?}", path) - }, None => panic!("Unexpected payment_path_failed call: {:?}", actual_path), } } @@ -1494,18 +1486,12 @@ mod tests { Some(TestResult::PaymentSuccess { path }) => { assert_eq!(actual_path, &path.iter().collect::>()[..]); }, - Some(TestResult::ProbeFailure { path, .. }) => { - panic!("Unexpected failed payment probe: {:?}", path) - }, - Some(TestResult::ProbeSuccess { path }) => { - panic!("Unexpected successful payment probe: {:?}", path) - }, None => panic!("Unexpected payment_path_successful call: {:?}", actual_path), } } } - fn probe_failed(&mut self, actual_path: &[&RouteHop], actual_short_channel_id: u64) { + fn probe_failed(&mut self, actual_path: &[&RouteHop], _: u64) { if let Some(expectations) = &mut self.expectations { match expectations.pop_front() { Some(TestResult::PaymentFailure { path, .. }) => { @@ -1514,13 +1500,6 @@ mod tests { Some(TestResult::PaymentSuccess { path }) => { panic!("Unexpected successful payment path: {:?}", path) }, - Some(TestResult::ProbeFailure { path, short_channel_id }) => { - assert_eq!(actual_path, &path.iter().collect::>()[..]); - assert_eq!(actual_short_channel_id, short_channel_id); - }, - Some(TestResult::ProbeSuccess { path }) => { - panic!("Unexpected successful payment probe: {:?}", path) - }, None => panic!("Unexpected payment_path_failed call: {:?}", actual_path), } } @@ -1534,12 +1513,6 @@ mod tests { Some(TestResult::PaymentSuccess { path }) => { panic!("Unexpected successful payment path: {:?}", path) }, - Some(TestResult::ProbeFailure { path, .. }) => { - panic!("Unexpected failed payment probe: {:?}", path) - }, - Some(TestResult::ProbeSuccess { path }) => { - assert_eq!(actual_path, &path.iter().collect::>()[..]); - }, None => panic!("Unexpected payment_path_successful call: {:?}", actual_path), } } -- 2.39.5