Repository navigation
Release v1.9.0 - #182
Closed
brunobar79 wants to merge 1 commit into
Closed
Release v1.9.0#182brunobar79 wants to merge 1 commit into
brunobar79 wants to merge 1 commit into
Conversation
Mrtenz
pushed a commit
that referenced
this pull request
Oct 16, 2025
Mrtenz
pushed a commit
that referenced
this pull request
Oct 16, 2025
* Refactor function to get cache identifier The function `cacheIdentifierForPayload` has been renamed to `cacheIdentifierForRequest`, and refactored to accept a JSON-RPC request rather than the `Payload` type. The function `paramsWithoutBlockTag` has been updated to accept a JSON- RPC request rather than a `Payload` as well. I noticed that this function wasn't being used anywhere, so the `export` was removed as well. The `block-cache` and `inflight-cache` middleware required some internal updates to accomodate these type changes. No functional changes or external-facing type changes have been made. Documentation and tests have been added. This brings test coverage for `cache.ts` up to 100%. Relates to #176 in that it helps unblock the necessary changes. * Make `method` parameter mandatory for cache utility functions The `method` parameter is now mandatory for the cache utility functions. It was only made optional in the first place as a side- effect of an erroneous type that was being used (`Payload`), which has now been replaced. * Remove leftover merge marger
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Sep 13, 2026
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Sep 13, 2026
Top of stack MetaMask#315, on MetaMask#321. `yarn test:types` runs bare `tsd`, which finds **no test files at all**. It produces no output and exits 0 regardless, so the 460 lines of type assertions across `src/*.test-d.ts` have not been checking anything. Proof, before this change: ``` $ printf 'expectAssignable<Hex>(999);' >> src/hex.test-d.ts $ yarn test:types $ echo $? 0 ``` Pointing tsd at the files explicitly reports it properly and exits 1: ``` ✖ Argument of type 999 is not assignable to parameter of type `0x${string}`. ``` ## Cause tsd resolves test files relative to the `types` field, which has pointed at `./dist/index.d.cts` since ts-bridge was adopted in MetaMask#182 (2024-04-23). tsd 0.29 does not resolve `.d.cts`, and the `tsd.directory` setting does not compensate. **26 releases** have shipped since, all with this check silently passing. ## Fix ```diff - "test:types": "tsd" + "test:types": "tsd --files 'src/*.test-d.ts'" ``` Fixing the invocation rather than the `types` field, since the field is correct for consumers and only tsd is confused by it. All four files pass once actually executed, so none of them needed changing. `yarn test:types` now exits 1 on a bad assertion and 0 when clean. ## Relevance to the migration This was found while working out what to do with tsd in Phase B, since core has no way to run it. Worth knowing the honest baseline before deciding: these assertions have been dormant for 17 months, so whatever we do with them in core, we are not losing coverage we currently have. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Only the npm script for type testing changed; runtime package behavior and public types are unchanged. > > **Overview** > **`yarn test:types` was a no-op:** bare `tsd` never picked up the `src/*.test-d.ts` suites (because of how it resolves files vs the package `types` entry), so type assertions could fail silently while CI still exited 0. > > The script now runs **`tsd --files 'src/*.test-d.ts'`**, so those assertions actually execute and **`yarn test:types` fails when a type check is wrong**. No changes to the test files themselves were required once they were being run. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b934063cc9e2ede2681fbc74c00c571deb68ebbe. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.