core
core copied to clipboard
Adapt to eip 1193 provider changes
Explanation
After SafeEventEmitterProvider is updated to support EIP-1193, we should adapt to the changes:
- Calling
sendAsyncwill be deprecated; we should userequestinstead.- Here is where we are doing this in the
corerepo:-
FakeProvider -
NetworkControllertests
-
- Additionally, there are places where we expect the provider that NetworkController returns to have a
sendAsyncmethod, and similarly, we should change this torequestand update the method signature appropriately:-
SelectedNetworkControllertests -
createAutoManagedNetworkClienttests
-
- Here is where we are doing this in the
References
- Fixes #4100
Changelog
@metamask/package-a
- <CATEGORY>: Your change here
- <CATEGORY>: Your change here
@metamask/package-b
- <CATEGORY>: Your change here
- <CATEGORY>: Your change here
Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate
No dependency changes detected. Learn more about Socket for GitHub ↗︎
👍 No dependency changes detected in pull request
These changes look good!
I noticed we left unchanged
FakeProvider: are we supposed to removesendAsyncfrom the class or any other changes related to this work?
Hi Michele,
FakeProvider has already been updated in a previous PR to include the request method. I had to make this change along with the SafeEventEmitterProvider updates; otherwise, the tests would not pass. You can see the updated FakeProvider here.