Skip to content

Commit 073232c

Browse files
committed
consensus: fix error message formatting
deference pointer & use %s for big int related to #33300 related to #33275 Signed-off-by: ferhat elmas <[email protected]>
1 parent da3822d commit 073232c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

consensus/beacon/consensus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
251251
return errors.New("missing withdrawalsHash")
252252
}
253253
if !shanghai && header.WithdrawalsHash != nil {
254-
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", header.WithdrawalsHash)
254+
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", *header.WithdrawalsHash)
255255
}
256256
// Verify the existence / non-existence of cancun-specific header fields
257257
cancun := chain.Config().IsCancun(header.Number, header.Time)

consensus/clique/clique.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
297297
}
298298
// Verify the non-existence of withdrawalsHash.
299299
if header.WithdrawalsHash != nil {
300-
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", header.WithdrawalsHash)
300+
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", *header.WithdrawalsHash)
301301
}
302302
if chain.Config().IsCancun(header.Number, header.Time) {
303303
return errors.New("clique does not support cancun fork")
@@ -345,7 +345,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainHeaderReader, header
345345
if !chain.Config().IsLondon(header.Number) {
346346
// Verify BaseFee not present before EIP-1559 fork.
347347
if header.BaseFee != nil {
348-
return fmt.Errorf("invalid baseFee before fork: have %d, want <nil>", header.BaseFee)
348+
return fmt.Errorf("invalid baseFee before fork: have %s, want <nil>", header.BaseFee)
349349
}
350350
if err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit); err != nil {
351351
return err

consensus/ethash/consensus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
252252
if !chain.Config().IsLondon(header.Number) {
253253
// Verify BaseFee not present before EIP-1559 fork.
254254
if header.BaseFee != nil {
255-
return fmt.Errorf("invalid baseFee before fork: have %d, expected 'nil'", header.BaseFee)
255+
return fmt.Errorf("invalid baseFee before fork: have %s, expected 'nil'", header.BaseFee)
256256
}
257257
if err := misc.VerifyGaslimit(parent.GasLimit, header.GasLimit); err != nil {
258258
return err
@@ -270,7 +270,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
270270
}
271271
// Verify the non-existence of withdrawalsHash.
272272
if header.WithdrawalsHash != nil {
273-
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", header.WithdrawalsHash)
273+
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", *header.WithdrawalsHash)
274274
}
275275
if chain.Config().IsCancun(header.Number, header.Time) {
276276
return errors.New("ethash does not support cancun fork")

0 commit comments

Comments
 (0)