-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate zero amount in a defined activity #180
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -475,6 +475,12 @@ 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 { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I think having the zero amount validation after the source and destination nodes validation makes more sense because the payment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Anyitechs. I see. This makes sense |
||||||
return Err(LightningError::ValidationError( | ||||||
"Expected amount_msat should be greater than zero.".to_string(), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the error message here can be more descriptive, because some users may find this hard to understand at first.
Suggested change
|
||||||
)); | ||||||
} | ||||||
// 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 | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs proper formatting. The contributing guide recommends running a
make check
command to check for lint errors and adhering to the linter suggestions made byclippy
.