1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +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 Dep upgrades and patches (#10903) 2021-04-20 13:39:49 +08:00
@fortawesome+fontawesome-free+5.13.0.patch Clear Sass deprecations (#13227) 2022-01-07 12:17:21 -07:00
@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 Add support for Smart Transactions (#12676) 2022-02-18 17:48:38 +01:00
@reduxjs+toolkit+1.6.2.patch Update build system lockdown parameter (#12556) 2021-11-01 22:13:22 -10:00
@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 Feature: Transaction Insights (#12881) 2021-12-01 13:52:08 -03:30
combine-source-map++convert-source-map+1.1.3.patch Fix Buffer warnings during build (#10495) 2021-09-27 19:05:35 -02:30
error+7.0.2.patch Add Lavamoat to build system (#9939) 2021-02-22 22:43:29 +08:00
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 Dep Upgrades for Lavamoat Patches (#10902) 2021-04-20 11:37:21 +08:00
gulp-sourcemaps+3.0.0.patch Fix Buffer warnings during build (#10495) 2021-09-27 19:05:35 -02:30
inline-source-map+0.6.2.patch Fix Buffer warnings during build (#10495) 2021-09-27 19:05:35 -02:30
luxon+1.26.0.patch Dep Upgrades for Lavamoat Patches (#10902) 2021-04-20 11:37:21 +08:00
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 Add Lavamoat to build system (#9939) 2021-02-22 22:43:29 +08:00
regenerator-runtime+0.13.7.patch LavaMoat Node update and various small enhancements (#12239) 2021-09-28 20:56:08 -10:00
sass+1.35.2.patch ci - enforce yarn lock deduplications (#12737) 2021-11-23 09:17:27 -10:00
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 Build - refactor for bundle factoring and swappable runtime (#11080) 2021-07-15 10:59:34 -07:00
stylelint+13.6.1.patch Add Lavamoat to build system (#9939) 2021-02-22 22:43:29 +08:00
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 Dep upgrades and patches (#10903) 2021-04-20 13:39:49 +08:00
watchify+4.0.0.patch Improve autorebuilding in dev to reduce CPU load (#11886) 2021-10-25 13:56:26 -06:00
web3+0.20.7.patch Dep upgrades and patches (#10903) 2021-04-20 13:39:49 +08:00
zxcvbn+4.4.2.patch Lavamoat - protect all UI contexts (#14537) 2022-04-28 08:45:46 -10:00