Skip to content

Commit

Permalink
chore: prevent network configuration properties from being modified
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Nov 22, 2024
1 parent 05ae2b3 commit 110c251
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class HardhatEthersProvider implements HardhatEthersProviderI {

readonly #hardhatProvider: EthereumProvider;
readonly #networkName: string;
readonly #networkConfig: NetworkConfig;
readonly #networkConfig: Readonly<NetworkConfig>;

// event-emitter related fields
#latestBlockNumberPolled: number | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Link {
export class HardhatHelpers {
readonly #provider: HardhatEthersProvider;
readonly #networkName: string;
readonly #networkConfig: NetworkConfig;
readonly #networkConfig: Readonly<NetworkConfig>;
readonly #artifactManager: ArtifactsManager;

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { isHttpNetworkConfig } from "./utils.js";
*/
export class JsonRpcRequestModifier {
readonly #provider: EthereumProvider;
readonly #networkConfig: NetworkConfig;
readonly #networkConfig: Readonly<NetworkConfig>;

// accounts
#localAccounts: LocalAccounts | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class NetworkConnectionImplementation<
{
public readonly id: number;
public readonly networkName: string;
public readonly networkConfig: NetworkConfig;
public readonly networkConfig: Readonly<NetworkConfig>;
public readonly chainType: ChainTypeT;

#provider!: EthereumProvider;
Expand Down
2 changes: 1 addition & 1 deletion v-next/hardhat/src/types/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface NetworkConnection<
> {
readonly id: number;
readonly networkName: string;
readonly networkConfig: NetworkConfig;
readonly networkConfig: Readonly<NetworkConfig>;
readonly chainType: ChainTypeT;
readonly provider: EthereumProvider;

Expand Down

0 comments on commit 110c251

Please sign in to comment.