Skip to content

Commit

Permalink
Block: allow sub class error to take on the type shapes of the generi…
Browse files Browse the repository at this point in the history
…c error by unionizing the types
  • Loading branch information
holgerd77 authored and jochem-brouwer committed Sep 30, 2024
1 parent 88e6a31 commit 0c9ba5e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/block/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { UsageError, ValidationError } from '@ethereumjs/util'

import type { ValidationErrorType } from '@ethereumjs/util'

/**
* Always define error codes on the generic Util
* error class level (e.g. associated to `ValidationError`)
Expand All @@ -12,10 +14,12 @@ export enum ValidationErrorCode {
* Additional types extending the generic Util
* error types (e.g. `ValidationErrorType`)
*/
export type HeaderValidationErrorType = {
block: string
received: string
}
export type HeaderValidationErrorType =
| {
block: string
received: string
}
| ValidationErrorType
export type HeaderUsageErrorType = {
block: string
}
Expand Down

0 comments on commit 0c9ba5e

Please sign in to comment.