-
Notifications
You must be signed in to change notification settings - Fork 950
Channel: Fix channel state max and add regression test #8420
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
Channel: Fix channel state max and add regression test #8420
Conversation
We could add a sentinel as the explicit last state so we wouldn't have to update the CHANNEL_STATE_MAX expr every time ...
|
Nit: I tested this.
Once all of those compiler errors are resolved the test |
190411f
to
9380369
Compare
Adds a test so CI will fail if CHANNEL_STATE_MAX isn’t updated when new channel states are added. Changelog-None
9380369
to
9fd9371
Compare
This PR has been tagged for the CLN September release. Please note that they will be moved to the next milestone if not merged by August 15th. |
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.
I tested it and now it does what it is supposed to do.
I don't have any judgement related to code conventions in Core-Lightning in this respect,
but I see it awkward that the unaware developer has to go through first a compiler
error and then a regression test fail to finally comprehend that CHANNEL_STATE_MAX
has to be updated. When all the information needed is available at compile time.
Unfortunately I cannot think of a better alternative besides the sentinel mentioned above
by @ksedgwic.
Twice now that I've been aware of the channel state max wasn't updated and it slipped through without being noticed.
This PR adds an explicit test so CI will fail if the max value isn't updated.