1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00
metamask-extension/patches
Elliot Winkler d91eabfd16
Add initial provider API tests for Infura client (#15556)
We are working on migrating the extension to a unified network
controller, but before we do so we want to extract some of the existing
pieces, specifically `createInfuraClient` and `createJsonRpcClient`,
which provide the majority of the behavior exhibited within the provider
API that the existing NetworkController exposes. This necessitates that
we understand and test that behavior as a whole.

With that in mind, this commit starts with the Infura-specific network
client and adds some initial functional tests for `createInfuraClient`,
specifically covering three pieces of middleware provided by
`eth-json-rpc-middleware`: `createNetworkAndChainIdMiddleware`,
`createBlockCacheMiddleware`, and `createBlockRefMiddleware`.

These tests exercise logic that originate from multiple different places
and combine in sometimes surprising ways, and as a result, understanding
the nature of the tests can be tricky. I've tried to explain the logic
(both of the implementation and the tests) via comments. Additionally,
debugging why a certain test is failing is not the most fun thing in the
world, so to aid with this, I've added some logging to the underlying
packages used when a request passes through the middleware stack.
Because some middleware change the request being made, or make new
requests altogether, this greatly helps to peel back the curtain, as
failures from Nock do not supply much meaningful information on their
own. This logging is disabled by default, but can be activated by
setting `DEBUG=metamask:*,eth-query DEBUG_COLORS=1` alongside the `jest`
command.

We use this logging by bumping `eth-block-tracker`, and
`eth-json-rpc-middleware`.
2022-09-16 10:48:33 -02:30
..
@babel+runtime+7.18.9.patch Update Babel and dependencies (#15392) 2022-08-05 10:04:44 -05:00
@eslint+eslintrc+1.3.0.patch Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
@formatjs+intl-utils+3.3.1.patch
@fortawesome+fontawesome-free+5.13.0.patch
@keystonehq+bc-ur-registry+0.4.4.patch Add TypeScript to the linting process (#13495) 2022-03-21 12:54:47 -06:00
@lavamoat+lavapack+3.1.0.patch Replace lavamoat-runtime.js patch (#15682) 2022-08-24 09:50:45 -02:30
@metamask+smart-transactions-controller++fast-json-patch+3.1.0.patch
@reduxjs+toolkit+1.6.2.patch
@types+jsdom++parse5+7.0.0.patch upgrade jest (#15642) 2022-08-23 15:13:02 -05:00
@types+madge+5.0.0.patch Add TypeScript migration dashboard (#13820) 2022-08-09 14:16:08 -06:00
abort-controller+3.0.0.patch Bump controllers v30.0.2 (#14906) 2022-07-18 09:43:30 -05:00
acorn-node++acorn+7.4.1.patch fix storybook (#15387) 2022-07-29 14:15:48 -05:00
await-semaphore+0.1.3.patch Add TypeScript to the linting process (#13495) 2022-03-21 12:54:47 -06:00
borc+2.1.2.patch fix: patch borc to avoid v8 bailing out of caching bytecode for the entire bundle chunk (#15385) 2022-07-29 16:24:12 -05:00
colors+1.4.0.patch
combine-source-map++convert-source-map+1.1.3.patch
error+7.0.2.patch
eslint-import-resolver-typescript+2.5.0.patch Add TypeScript to the linting process (#13495) 2022-03-21 12:54:47 -06:00
eslint+8.20.0.patch Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
eth-query+2.1.2.patch Add initial provider API tests for Infura client (#15556) 2022-09-16 10:48:33 -02:30
eth-sig-util++ethereumjs-util+5.2.1.patch deps - patch ethereumjs-util/dist/secp256k1 for fast module init via lazy loading (#14682) 2022-08-09 13:40:33 -05:00
fast-json-patch+2.2.1.patch
gulp-sourcemaps+3.0.0.patch
inline-source-map+0.6.2.patch
luxon+1.26.0.patch
object.values+1.1.5.patch Update object.values patch (#15692) 2022-08-24 12:46:37 -07:00
plugin-error+1.0.1.patch
regenerator-runtime+0.13.7.patch
sass+1.35.2.patch
secp256k1+3.8.0.patch deps - patch secp256k1 for fast module init via lazy loading (#14677) 2022-05-11 13:21:23 -10:00
squirrelly+8.0.8.patch
stylelint+13.6.1.patch
typescript+4.4.4.patch Add TypeScript to the linting process (#13495) 2022-03-21 12:54:47 -06:00
undeclared-identifiers+1.1.2.patch
watchify+4.0.0.patch
web3+0.20.7.patch
zxcvbn+4.4.2.patch Lavamoat - protect all UI contexts (#14537) 2022-04-28 08:45:46 -10:00