From af5ae7337ccc8306df2d0df8a34e4c7895b299cc Mon Sep 17 00:00:00 2001 From: Joseph Murgor Date: Tue, 23 Apr 2024 12:08:54 +0300 Subject: [PATCH] fixed lint issue. Moved validation of amount_msat to after the source and the destination node validation --- sim-lib/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sim-lib/src/lib.rs b/sim-lib/src/lib.rs index 66537b73..cc1ebdf6 100644 --- a/sim-lib/src/lib.rs +++ b/sim-lib/src/lib.rs @@ -475,12 +475,6 @@ impl Simulation { } for payment_flow in self.activity.iter() { - // lets validate the amount_msats to be greater than zero - if payment_flow.amount_msat==0 { - return Err(LightningError::ValidationError( - "Expected amount_msat should be greater than zero.".to_string(), - )); - } // We need every source node that is configured to execute some activity to be included in our set of // nodes so that we can execute events on it. self.nodes @@ -498,6 +492,12 @@ impl Simulation { payment_flow.destination, ))); } + // lets validate the amount_msats to be greater than zero + if payment_flow.amount_msat == 0 { + return Err(LightningError::ValidationError( + "Expected amount_msat should be greater than zero.".to_string(), + )); + } } Ok(())