From: Matt Corallo Date: Tue, 26 Jul 2022 20:31:17 +0000 (+0000) Subject: Drop unused test code in `lightning-invoice::payment` X-Git-Tag: v0.0.111~51^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2022-07-warnings;p=rust-lightning Drop unused test code in `lightning-invoice::payment` --- 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), } }