Skip to content

Commit

Permalink
update @metamask/utils v7 usage
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Aug 24, 2023
1 parent e4f1a74 commit 3d5cc03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/middleware/createRpcWarningMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('createRpcWarningMiddleware', () => {
method,
})) as JsonRpcFailure;

expect(result.error.message).toBe('Failure!');
expect(result.error.message).toBe('Internal JSON-RPC error.');
});
});

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('createRpcWarningMiddleware', () => {
params,
})) as JsonRpcFailure;

expect(result.error.message).toBe('Failure!');
expect(result.error.message).toBe('Internal JSON-RPC error.');
});
});
});
5 changes: 3 additions & 2 deletions test/mocks/MockConnectionStream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Json,
JsonRpcNotification,
JsonRpcRequest,
JsonRpcResponse,
Expand Down Expand Up @@ -71,7 +72,7 @@ export class MockConnectionStream extends Duplex {
* @param substream - The substream this reply is included in.
* @param message - The JSON RPC response.
*/
reply(substream: string, message: JsonRpcResponse) {
reply(substream: string, message: JsonRpcResponse<Json>) {
this.push({ name: substream, data: message });
}

Expand All @@ -81,7 +82,7 @@ export class MockConnectionStream extends Duplex {
* @param substream - The substream this notification is included in.
* @param message - The JSON RPC notification.
*/
notify(substream: string, message: JsonRpcNotification<unknown>) {
notify(substream: string, message: JsonRpcNotification) {
this.push({ name: substream, data: message });
}
}
3 changes: 2 additions & 1 deletion test/mocks/MockPort.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Json,
JsonRpcNotification,
JsonRpcRequest,
JsonRpcResponse,
Expand Down Expand Up @@ -77,7 +78,7 @@ export class MockPort {
* @param substream - The substream this reply is included in.
* @param message - The JSON RPC response.
*/
reply(substream: string, message: JsonRpcResponse) {
reply(substream: string, message: JsonRpcResponse<Json>) {
if (!this.#connected) {
throw new Error(
'It is not possible to reply after the port has disconnected',
Expand Down

0 comments on commit 3d5cc03

Please sign in to comment.