1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Re-enable tests for subscription-based RPC methods (#18994)

NetworkController doesn't handle `eth_subscribe` or `eth_unsubscribe`
specially, but as it's supported by Infura, we want to make sure we
exercise these RPC methods in the network client tests, even if it is
just to ensure that they get passed through to the network.

We had tests for these RPC methods, but they were commented out in
c095b1accd when the network client code
was extracted to a separate file. At the time we were considering adding
subscription- and filter-based middleware to NetworkController, and so
we commented out the tests for `eth_subscribe` and `eth_unsubscribe`
temporarily until we could rewrite them in a way that would exercise the
new middleware. We reverted that change in
bd23a49013, which meant that we could
restore the existing tests, but it appears that this task was not caught
during review. This commit takes care of restoring them.

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
This commit is contained in:
Elliot Winkler 2023-05-10 06:04:10 -06:00 committed by GitHub
parent 23b8b15e5c
commit 05fb01802d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,9 +295,8 @@ export function testsForProviderType(providerType: ProviderType) {
// tests on the core side.
{ name: 'net_listening', numberOfParameters: 0 },
// TODO: Methods to add back when we add testing for subscribe middleware
// { name: 'eth_subscribe', numberOfParameters: 1 },
// { name: 'eth_unsubscribe', numberOfParameters: 1 },
{ name: 'eth_subscribe', numberOfParameters: 1 },
{ name: 'eth_unsubscribe', numberOfParameters: 1 },
{ name: 'custom_rpc_method', numberOfParameters: 1 },
{ name: 'net_peerCount', numberOfParameters: 0 },
{ name: 'parity_nextNonce', numberOfParameters: 1 },