Skip to content

Commit

Permalink
Resolve the EDR cache path config
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado committed Oct 28, 2024
1 parent a63917d commit 4718753
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import type {
} from "../../../../types/config.js";
import type { ConfigHooks } from "../../../../types/hooks.js";

import path from "node:path";

import { HardhatError } from "@ignored/hardhat-vnext-errors";
import { normalizeHexString } from "@ignored/hardhat-vnext-utils/hex";
import { resolveFromRoot } from "@ignored/hardhat-vnext-utils/path";

import { validateUserConfig } from "../type-validation.js";

Expand Down Expand Up @@ -228,6 +231,13 @@ export async function resolveUserConfig(
gasPrice: resolveGasConfig(networkConfig.gasPrice),
// TODO: This isn't how it's called in v2
forkConfig: networkConfig.forkConfig,
forkCachePath:
networkConfig.forkCachePath !== undefined
? resolveFromRoot(
resolvedConfig.paths.root,
networkConfig.forkCachePath,
)
: path.join(resolvedConfig.paths.cache, "edr-cache"),
hardfork: networkConfig.hardfork ?? "cancun",
networkId: networkConfig.networkId ?? networkConfig.chainId ?? 31337,
blockGasLimit: networkConfig.blockGasLimit ?? 12_500_000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ declare module "../../../../types/config.js" {
initialDate?: Date;
coinbase?: string;
forkConfig?: ForkConfig;
forkCachePath?: string;
forkCachePath: string;
}

export type EdrNetworkAccountsConfig =
Expand Down

0 comments on commit 4718753

Please sign in to comment.