forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cln-plugin: Defer binding the plugin state until after configuring
We had a bit of a chicken-and-egg problem, where we instantiated the `state` to be managed by the `Plugin` during the very first step when creating the `Builder`, but then the state might depend on the configuration we only get later. This would force developers to add placeholders in the form of `Option` into the state, when really they'd never be none after configuring. This defers the binding until after we get the configuration and cleans up the semantics: - `Builder`: declare options, hooks, etc - `ConfiguredPlugin`: we have exchanged the handshake with `lightningd`, now we can construct the `state` accordingly - `Plugin`: Running instance of the plugin Changelog-Changed: cln-plugin: Moved the state binding to the plugin until after the configuration step
- Loading branch information
Showing
4 changed files
with
114 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters