Skip to content

Commit

Permalink
chore: consistently include code in block error metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Dec 1, 2023
1 parent 9475b8d commit da12c7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/beacon-node/src/chain/errors/blockError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,19 @@ export function renderBlockErrorType(type: BlockErrorType): Record<string, strin
case BlockErrorCode.PER_BLOCK_PROCESSING_ERROR:
case BlockErrorCode.BEACON_CHAIN_ERROR:
return {
code: type.code,
error: type.error.message,
};

case BlockErrorCode.INVALID_SIGNATURE:
return {
code: type.code,
slot: type.state.slot,
};

case BlockErrorCode.INVALID_STATE_ROOT:
return {
code: type.code,
slot: type.postState.slot,
root: toHexString(type.root),
expectedRoot: toHexString(type.expectedRoot),
Expand Down

0 comments on commit da12c7d

Please sign in to comment.