Skip to content

Commit

Permalink
fix: pass HTTP to EDR
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Oct 24, 2024
1 parent f6ac346 commit f2d46e3
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
RawTrace,
Response,
SubscriptionEvent,
HttpHeader,
} from "@nomicfoundation/edr";
import { Common } from "@nomicfoundation/ethereumjs-common";
import chalk from "chalk";
Expand Down Expand Up @@ -201,12 +202,27 @@ export class EdrProviderWrapper

let fork;
if (config.forkConfig !== undefined) {
let httpHeaders: HttpHeader[] | undefined;
if (config.forkConfig.httpHeaders !== undefined) {
httpHeaders = [];

for (const [name, value] of Object.entries(
config.forkConfig.httpHeaders
)) {
httpHeaders.push({
name,
value,
});
}
}

fork = {
jsonRpcUrl: config.forkConfig.jsonRpcUrl,
blockNumber:
config.forkConfig.blockNumber !== undefined
? BigInt(config.forkConfig.blockNumber)
: undefined,
httpHeaders,
};
}

Expand Down

0 comments on commit f2d46e3

Please sign in to comment.