Skip to content

Configuration for default network is ignored #7795

@fvictorio

Description

@fvictorio

Describe the issue

Using a config that sets the default network to point to localhost:8545 doesn't work. Take this config:

import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem";
import { defineConfig } from "hardhat/config";

export default defineConfig({
  plugins: [hardhatToolboxViemPlugin],
  solidity: "0.8.31",
  networks: {
    default: {
      type: "http",
      url: "http://localhost:8545"
    },
  },
});

and run hh test nodejs. It should fail (assuming no node is running), but it works. Worse, running hh test nodejs --network default also doesn't seem to work as expected. Renaming the network to default2 and running hh test nodejs --network default2 does produce the expected behavior (tests fail because it cannot connect to the network).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions