-
-
Notifications
You must be signed in to change notification settings - Fork 250
refactor!: Replace SafeEventEmitterProvider
with InternalProvider
#6796
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
base: main
Are you sure you want to change the base?
Conversation
SafeEventEmitterProvider
with InternalProvider
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 think there's one thing with the proxies that we may want to adjust, but the rest looks good. Thank you for removing the lint warnings as well!
Can you:
- generate preview builds
- make a new branch on Extension, upgrade
network-controller
to the preview build, push the PR, and wait for CI to pass - build the extension locally, open the test dapp, and make sure you can still make network requests on different chains
- do the same thing for mobile
Let me know if you want to tag team this, I have a bit of time now.
packages/selected-network-controller/src/SelectedNetworkController.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Elliot Winkler <[email protected]>
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
cc: @mcmire |
@mcmire no problem, I'll keep this as a draft until you tell me otherwise. |
Explanation
As of #6328
SafeEventEmitterProvider
no longer used theEventEmitter
API, making its name misleading. Consequently, this PR renames it toInternalProvider
and stops extendingSafeEventEmitter
. This new name better reflects its use as an internal-only provider that does not conform to any particular standard.SafeEventEmitterProvider
is still exported as a deprecated alias ofInternalProvider
in order to resolve a dependency with the repo-external package@metamask/eth-json-rpc-middleware
. Once this package has been updated to use the new name, this alias can be removed.References
Closes #6594
Checklist
Note
Replaces
SafeEventEmitterProvider
with newInternalProvider
(deprecated alias retained), updates consumers to use it, and swaps provider proxies to swappable proxies, with accompanying tests and changelogs.InternalProvider
(no longer extendsSafeEventEmitter
); deprecate-exportSafeEventEmitterProvider
as alias.@metamask/safe-event-emitter
dependency.SafeEventEmitterProvider
toInternalProvider
.createSwappableProxy
(keep block tracker viacreateEventEmitterProxy
).createSwappableProxy
for provider proxies; compatible withInternalProvider
.FakeProvider
,FakeBlockTracker
, bridge/tx tests) to new provider type.Written by Cursor Bugbot for commit b5bcc2c. This will update automatically on new commits. Configure here.