Skip to content

Commit

Permalink
Rename config to namespacedCompileErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Oct 7, 2024
1 parent 981da44 commit 1c48b6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-hardhat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ subtask(TASK_COMPILE_SOLIDITY_COMPILE, async (args: RunCompilerArgs, hre, runSup
'This step allows for advanced storage modifications such as tight varible packing when performing upgrades with namespaced storage layouts.',
];

switch (hre.config.namespacedCompileFailure) {
switch (hre.config.namespacedCompileErrors) {
case undefined:
case 'error': {
const { UpgradesError } = await import('@openzeppelin/upgrades-core');
const details = [
...preamble,
'If you are not using namespaced storage, or if you do not anticipate making advanced modifications to namespaces during upgrades,',
"set namespacedCompileFailure: 'warn' or namespacedCompileFailure: 'ignore' in your hardhat config to convert this to a warning or to ignore this.",
"set namespacedCompileErrors: 'warn' or namespacedCompileErrors: 'ignore' in your hardhat config to convert this to a warning or to ignore this.",
];
throw new UpgradesError(msg, () => details.join('\n'));
}
Expand All @@ -128,15 +128,15 @@ subtask(TASK_COMPILE_SOLIDITY_COMPILE, async (args: RunCompilerArgs, hre, runSup
const details = [
...preamble,
'If you are not using namespaced storage, or if you do not anticipate making advanced modifications to namespaces during upgrades,',
"set namespacedCompileFailure: 'ignore' in your hardhat config to ignore this.",
"set namespacedCompileErrors: 'ignore' in your hardhat config to ignore this.",
];
logWarning(msg, details);
break;
}
case 'ignore':
break;
default:
assertUnreachable(hre.config.namespacedCompileFailure);
assertUnreachable(hre.config.namespacedCompileErrors);
}

namespacedOutput = undefined;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-hardhat/src/type-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export interface HardhatDefenderConfig {
network?: string;
}

export type NamespacedCompileFailureRule = 'error' | 'warn' | 'ignore';
export type NamespacedCompileErrorsRule = 'error' | 'warn' | 'ignore';

declare module 'hardhat/types/config' {
export interface HardhatUserConfig {
defender?: HardhatDefenderConfig;
namespacedCompileFailure?: NamespacedCompileFailureRule;
namespacedCompileErrors?: NamespacedCompileErrorsRule;
}

export interface HardhatConfig {
defender?: HardhatDefenderConfig;
namespacedCompileFailure?: NamespacedCompileFailureRule;
namespacedCompileErrors?: NamespacedCompileErrorsRule;
}
}

0 comments on commit 1c48b6c

Please sign in to comment.