Validation: Do not allow defined activity with zero amount
Opened this issue · 4 comments
Currently, we allow zero amount payments to be skipped over to allow for the possibility that our random payment amount generation spits out a zero value every once in an hour.
Right now we don't validate that we're provided with a non-zero defined activity amount, so we'll hit the same check and just endlessly not dispatch payments if we're given a zero value.
We should update validate_activity to disallow zero values.
@carlaKC
On validate_activity function I added validation to check for zero amount_msats.
![Screenshot 2024-04-15 at 10 26 11](https://private-user-images.githubusercontent.com/3397641/322389385-103f2df2-8d25-449b-b1e4-4d8d19a63b54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1MTc4NDQsIm5iZiI6MTcyNTUxNzU0NCwicGF0aCI6Ii8zMzk3NjQxLzMyMjM4OTM4NS0xMDNmMmRmMi04ZDI1LTQ0OWItYjFlNC00ZDhkMTlhNjNiNTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMDYyNTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWU4ZTdmZWUwNTM2NjQyZTBlNGE3ZWIyNTlmZmZkNjNkOWYwNjNkNTRlZWFiYTA3NzAyMGE0YWMwMjY1NTkxZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.mWJdoGe5pHrVOLQ8Z0U4lB70y2u2UBc6DghulesVnZA)
On running cargo run I get the validation error
![Screenshot 2024-04-15 at 10 28 59](https://private-user-images.githubusercontent.com/3397641/322389973-e4767bec-2648-471b-8877-8fdae20bd5dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1MTc4NDQsIm5iZiI6MTcyNTUxNzU0NCwicGF0aCI6Ii8zMzk3NjQxLzMyMjM4OTk3My1lNDc2N2JlYy0yNjQ4LTQ3MWItODg3Ny04ZmRhZTIwYmQ1ZGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMDYyNTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2MxNWZjM2RmZTJmODE4MjhmMjI2ZTA2ZGEzODVjMWJiMTEwOGYyNzZhMGIzMGIzY2UwNWEwMjdlMGU2ODE4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.hsnf9rB0x5hFzFLfZPmwP_B-4sLC9vH6CfAdLUC41kk)
Which is fine but it seems to skip on running sim-cli
![Screenshot 2024-04-15 at 10 30 12](https://private-user-images.githubusercontent.com/3397641/322390295-b81e841a-4b9c-454f-86eb-062a5572e857.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1MTc4NDQsIm5iZiI6MTcyNTUxNzU0NCwicGF0aCI6Ii8zMzk3NjQxLzMyMjM5MDI5NS1iODFlODQxYS00YjljLTQ1NGYtODZlYi0wNjJhNTU3MmU4NTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDVUMDYyNTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGRjOTRhOTA3ZDA3N2M1NzEyYTc5N2MyYThjYTQ3NzYwOGM2NTY5NDczNTQ3ZDA5MzllMjhlNmZmZWMwMGZhYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.MrrmUvwRgRtiuXjvw4FCTsZ8VHZemyRsiHLjG5wJdO0)
Is that the expected behaviour?
Which is fine but it seems to skip on running sim-cli
Have you re-installed sim-cli before you test?
Which is fine but it seems to skip on running sim-cli
Have you re-installed sim-cli before you test?
That fixed it. Thank you