Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/eth-json-rpc-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING:** Remove `'data'` event ([#6328](https://github.com/MetaMask/core/pull/6328))
- This event was forwarding the `'notification'` event from the underlying `JsonRpcEngine`. It was rarely used in practice, and is now removed.
- Bump `@metamask/utils` from `^11.2.0` to `^11.4.2` ([#6054](https://github.com/MetaMask/core/pull/6054))

## [4.1.8]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@ function createMockEngine(method: string, response: Json) {
}

describe('SafeEventEmitterProvider', () => {
describe('constructor', () => {
it('listens for notifications from provider, emitting them as "data"', async () => {
const engine = new JsonRpcEngine();
const provider = new SafeEventEmitterProvider({ engine });
const notificationListener = jest.fn();
provider.on('data', notificationListener);

// `json-rpc-engine` v6 does not support JSON-RPC notifications directly,
// so this is the best way to emulate this behavior.
// We should replace this with `await engine.handle(notification)` when we update to v7
// TODO: v7 is now integrated; fix this
engine.emit('notification', 'test');

expect(notificationListener).toHaveBeenCalledWith(null, 'test');
});

it('does not throw if engine does not support events', () => {
// TODO: Replace `any` with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const engine = new JsonRpcEngine() as any;
delete engine.on;

expect(() => new SafeEventEmitterProvider({ engine })).not.toThrow();
});
});

it('returns the correct block number with @metamask/eth-query', async () => {
const provider = new SafeEventEmitterProvider({
engine: createMockEngine('eth_blockNumber', 42),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ export class SafeEventEmitterProvider extends SafeEventEmitter {
constructor({ engine }: { engine: JsonRpcEngine }) {
super();
this.#engine = engine;

if (engine.on) {
engine.on('notification', (message: string) => {
this.emit('data', null, message);
});
}
}

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/network-enablement-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add Bitcoin network support with automatic enablement when configured in MultichainNetworkController ([#6455](https://github.com/MetaMask/core/pull/6455))
- Add `BtcScope` enum for Bitcoin mainnet and testnet caip chain IDs ([#6455](https://github.com/MetaMask/core/pull/6455))
- Add Bitcoin network enablement logic to `init()` and `enableAllPopularNetworks()` methods ([#6455](https://github.com/MetaMask/core/pull/6455))

### Changed

- Bump `@metamask/base-controller` from `^8.2.0` to `^8.3.0` ([#6465](https://github.com/MetaMask/core/pull/6465))
Expand Down
Loading
Loading