( invariant: boolean, message: string, )
| 230 | * @param message A message to show if the condition is false. |
| 231 | */ |
| 232 | export 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 | |
| 241 | function getErrorCode(errorDescriptor: ErrorDescriptor): string { |
| 242 | return `${ERROR_PREFIX}${errorDescriptor.number}`; |
no outgoing calls
no test coverage detected