core icon indicating copy to clipboard operation
core copied to clipboard

Adapt to eip 1193 provider changes

Open cryptodev-2s opened this issue 1 year ago • 2 comments

Explanation

After SafeEventEmitterProvider is updated to support EIP-1193, we should adapt to the changes:

  • Calling sendAsync will be deprecated; we should use request instead.
    • Here is where we are doing this in the core repo:
      • FakeProvider
      • NetworkController tests
    • Additionally, there are places where we expect the provider that NetworkController returns to have a sendAsync method, and similarly, we should change this to request and update the method signature appropriately:
      • SelectedNetworkController tests
      • createAutoManagedNetworkClient tests

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

cryptodev-2s avatar Jun 20 '24 15:06 cryptodev-2s

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

socket-security[bot] avatar Jun 20 '24 15:06 socket-security[bot]

These changes look good!

I noticed we left unchanged FakeProvider: are we supposed to remove sendAsync from 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.

cryptodev-2s avatar Jul 09 '24 12:07 cryptodev-2s