Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/eth-block-tracker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Promote `@metamask/json-rpc-engine` from a dev dependency to a production dependency, so the `ContextConstraint` and `MiddlewareContext` types it contributes to `PollingBlockTracker`'s public declaration files resolve for downstream consumers ([#6864](https://github.com/MetaMask/core/issues/6864))
- Deduplicate concurrent `checkForLatestBlock()` calls so they share a single ongoing request and resolve to the same promise, instead of each issuing its own `eth_blockNumber` request ([#7905](https://github.com/MetaMask/core/pull/7905))

## [15.0.1]
Expand Down
2 changes: 1 addition & 1 deletion packages/eth-block-tracker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
},
"dependencies": {
"@metamask/eth-json-rpc-provider": "^6.0.1",
"@metamask/json-rpc-engine": "^10.5.0",
"@metamask/safe-event-emitter": "^3.0.0",
"@metamask/utils": "^11.11.0",
"json-rpc-random-id": "^1.0.1"
},
"devDependencies": {
"@metamask/auto-changelog": "^6.1.0",
"@metamask/json-rpc-engine": "^10.5.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^30.0.0",
"@types/json-rpc-random-id": "^1.0.1",
Expand Down
22 changes: 22 additions & 0 deletions packages/eth-block-tracker/src/dependencies.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';

describe('@metamask/eth-block-tracker package manifest', () => {
it('declares @metamask/json-rpc-engine as a production dependency', () => {
// `PollingBlockTracker.ts` imports the `ContextConstraint` and
// `MiddlewareContext` types from `@metamask/json-rpc-engine/v2` with a
// type-only import. Those types leak into the published declaration files
// through `PollingBlockTrackerOptions` and the `PollingBlockTracker` class
// generic, so consumers need `@metamask/json-rpc-engine` resolvable when
// type-checking against this package. It must therefore be a production
// dependency rather than only a devDependency.
//
// Regression test for https://github.com/MetaMask/core/issues/6864
const packageJsonPath = resolve(__dirname, '..', 'package.json');
const { dependencies } = JSON.parse(
readFileSync(packageJsonPath, 'utf8'),
) as { dependencies: Record<string, string> };

expect(dependencies['@metamask/json-rpc-engine']).toBeDefined();
});
});