Skip to content

Commit

Permalink
align response type in internal performFetch
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Sep 21, 2023
1 parent 6de00c1 commit d12022b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/create-infura-middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { createAsyncMiddleware } from '@metamask/json-rpc-engine';
import type { JsonRpcError } from '@metamask/rpc-errors';
import { rpcErrors } from '@metamask/rpc-errors';
import type { JsonRpcParams, PendingJsonRpcResponse } from '@metamask/utils';
import type {
Json,
JsonRpcParams,
PendingJsonRpcResponse,
} from '@metamask/utils';
// eslint-disable-next-line @typescript-eslint/no-shadow
import fetch from 'node-fetch';

Expand Down Expand Up @@ -87,8 +91,7 @@ export function createInfuraMiddleware({
projectId,
headers,
req,
// TODO: investigate type mismatch
res as any,
res,
source,
);
// request was successful
Expand Down Expand Up @@ -156,7 +159,7 @@ async function performFetch(
projectId: string,
extraHeaders: RequestHeaders,
req: ExtendedJsonRpcRequest<JsonRpcParams>,
res: PendingJsonRpcResponse<JsonRpcParams>,
res: PendingJsonRpcResponse<Json>,
source: string | undefined,
): Promise<void> {
const { fetchUrl, fetchParams } = fetchConfigFromReq({
Expand Down

0 comments on commit d12022b

Please sign in to comment.