Skip to content

Commit

Permalink
block: move consensus format validation to corret place
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Jul 9, 2022
1 parent 1ba41f4 commit f6168c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export class BlockHeader {
this.baseFeePerGas = baseFeePerGas

this._genericFormatValidation()
this._consensusFormatValidation()
this._validateDAOExtraData()

// Now we have set all the values of this Header, we possibly have set a dummy
Expand All @@ -283,6 +282,9 @@ export class BlockHeader {
this.extraData = this.cliqueSealBlock(options.cliqueSigner)
}

// Validate consensus format after block is sealed (if applicable) so extraData checks will pass
this._consensusFormatValidation()

const freeze = options?.freeze ?? true
if (freeze) {
Object.freeze(this)
Expand Down

0 comments on commit f6168c5

Please sign in to comment.