-
Notifications
You must be signed in to change notification settings - Fork 912
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
Plugin config options with no defaults #5369
Conversation
Christian sent this message in Discord and I'm just copying it here so I don't forget about it!
|
@justinmoon we're looking to get an RC candidate cut this week; should this patch be considered as a candidate for inclusion? |
No. It will probably take me a while to polish this off. |
Whoops, I missed that this is still in draft (will mark it as such) so I rebased on top of Just out of curiosity, what's missing for it to be complete? To me it looks good to go (save name-bikeshedding ^^). |
I don't remember. IIRC it works. I think you were concerned about the |
Roger that, I'll be happy to shepherd it from here ^^ Thanks @justinmoon :-) |
Changelog-Added: cln-plugin: Options are no longer required to have a default value
I'm making a plugin for minimint that requires a config directory path which we don't want to set a default for.
I'm currently hardcoding "default-dont-use" as default and panic later if this is still the value after initialization.
This PR makes it so I don't have to set a default.
It would be nicer if we could just make
ConfigOption.default
into anOption
, but your serialization code forConfigOption
depends on thedefault
field to figure out what the type of the parameter is. So it wouldn't work to just have it beNone
because then you wouldn't know the type.