MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / assertHardhatInvariant

Function assertHardhatInvariant

packages/hardhat-errors/src/errors.ts:232–239  ·  view source on GitHub ↗
(
  invariant: boolean,
  message: string,
)

Source from the content-addressed store, hash-verified

230 * @param message A message to show if the condition is false.
231 */
232export function assertHardhatInvariant(
233 invariant: boolean,
234 message: string,
235): asserts invariant {
236 if (!invariant) {
237 throw new HardhatError(ERRORS.CORE.INTERNAL.ASSERTION_ERROR, { message });
238 }
239}
240
241function getErrorCode(errorDescriptor: ErrorDescriptor): string {
242 return `${ERROR_PREFIX}${errorDescriptor.number}`;

Callers 15

pathFunction · 0.90
getAddressMethod · 0.90
signPersonalMessageMethod · 0.90
signEIP712MessageMethod · 0.90
signTransactionMethod · 0.90
handler.tsFile · 0.90
createTxFunction · 0.90
#ethSignMethod · 0.90
#derivePathMethod · 0.90
#toRpcSigMethod · 0.90
#personalSignMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected