-
Notifications
You must be signed in to change notification settings - Fork 162
feat: inject controllers using metadata's definition of pallets #1592
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
Conversation
|
Question: Don't we no longer need the chains-config |
It depends if the user decides to inject the controllers or use configurations using the SAS_EXPRESS_CONTROLLERS_CONFIG flag. I'm also using it for the tests but happy to move it outside/on a separate config file |
TarikGul
left a comment
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.
LGTM!
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
9326d44 to
afa027c
Compare
Imod7
left a comment
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.
Looks great! 💯 This is such a great feature so kudos for the initiative and the excellent suggestion. Also, the implementation was super fast!
This PR aims to introduce a new method to inject the required/available controllers for a chain in express by using the pallets defined in the metadata of such chain. It also allows to add a config file in chains_config and then use that by setting SAS_EXPRESS_CONTROLLERS_CONFIG to true.
Each controller now requires two new static variables: controllerName and requiredPallets
ControllerName is the name of the controller to be used in the configs and requiredPallets are the pallets required in the metadata to have the controller injected in the server.