Skip to content

Commit

Permalink
fixed lint issue. Moved validation of amount_msat to after the source…
Browse files Browse the repository at this point in the history
… and the destination node validation
  • Loading branch information
joseguru committed Apr 23, 2024
1 parent 127c850 commit af5ae73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sim-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(())
Expand Down

0 comments on commit af5ae73

Please sign in to comment.