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 committed May 27, 2022
1 parent de70270 commit 92f93d9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/block/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UsageError, ValidationError } from 'ethereumjs-util'
import { UsageError, ValidationError, ValidationErrorType } from 'ethereumjs-util'

/**
* Always define error codes on the generic Util
Expand All @@ -12,10 +12,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 92f93d9

Please sign in to comment.