-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: add NetworkController NetworkConfiguration actions and events #4698
feat: add NetworkController NetworkConfiguration actions and events #4698
Conversation
5c85bb9
to
2226588
Compare
actions and events for adding, updating, and removing a network configuration
75361eb
to
27c18aa
Compare
…network-events-actions
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!!
…network-events-actions
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.
One missing test, but otherwise this looks good to me.
@Prithpal-Sooriya The addition of the actions/events will be breaking changes to the NetworkController (since clients will need to amend the allowlists they pass to the NetworkController messenger). That's fine, but can you update the PR description to reflect this? Typically we just prepend the changelog entries that refer to breaking changes with |
@mcmire Done. Do additions (new actions/events) count as breaking? Wouldn't clients/consumers of this controller need to update their allowedActions/events only if they do call/subscribe to them |
@Prithpal-Sooriya Good point! If the controller calls new actions or subscribes to new events outside of itself, then those actions/events would need to be added to the controller messenger's allowlists, and the client would have to do that. But in this case since the actions/events being added are internal to NetworkController, you are right, it wouldn't cause anything to break immediately. So maybe it's inappropriate to mark these changes as breaking. Sorry for the confusion. |
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.
Sorry one more thing!
Co-authored-by: Elliot Winkler <[email protected]>
…etaMask/core into NOTIFY-1089/add-network-events-actions
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 good!
These changes aren't breaking, right? There are no new allowed actions/events here. No restricted messenger changes. |
Explanation
This adds and exposes some new actions and events inside the network controller.
Events:
NetworkController:networkRemoved
Actions
NetworkController:updateNetwork
NetworkController:addNetwork
NetworkController:removeNetwork
These will be used for the network syncing feature (see references)
References
https://consensyssoftware.atlassian.net/browse/NOTIFY-1089
Changelog
@metamask/network-controller
NetworkController:networkRemoved
NetworkController:addNetwork
;NetworkController:removeNetwork
;NetworkController:updateNetwork
Checklist