Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth,consensus: replace noarg fmt.Errorf with errors.New #27330

Merged
merged 2 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
consensus: replace noarg fmt.Errorf with errors.New
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed May 24, 2023
commit b9f46367c4ea00127112f86efac09ce14d5d0c64
4 changes: 2 additions & 2 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, params.MaxGasLimit)
}
if chain.Config().IsShanghai(header.Number, header.Time) {
return fmt.Errorf("clique does not support shanghai fork")
return errors.New("clique does not support shanghai fork")
}
if chain.Config().IsCancun(header.Number, header.Time) {
return fmt.Errorf("clique does not support cancun fork")
return errors.New("clique does not support cancun fork")
}
// All basic checks passed, verify cascading fields
return c.verifyCascadingFields(chain, header, parents)
Expand Down
4 changes: 2 additions & 2 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
return consensus.ErrInvalidNumber
}
if chain.Config().IsShanghai(header.Number, header.Time) {
return fmt.Errorf("ethash does not support shanghai fork")
return errors.New("ethash does not support shanghai fork")
}
if chain.Config().IsCancun(header.Number, header.Time) {
return fmt.Errorf("ethash does not support cancun fork")
return errors.New("ethash does not support cancun fork")
}
// Add some fake checks for tests
if ethash.fakeDelay != nil {
Expand Down
3 changes: 2 additions & 1 deletion consensus/misc/eip1559.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package misc

import (
"errors"
"fmt"
"math/big"

Expand All @@ -40,7 +41,7 @@ func VerifyEip1559Header(config *params.ChainConfig, parent, header *types.Heade
}
// Verify the header is not malformed
if header.BaseFee == nil {
return fmt.Errorf("header is missing baseFee")
return errors.New("header is missing baseFee")
}
// Verify the baseFee is correct based on the parent header.
expectedBaseFee := CalcBaseFee(config, parent)
Expand Down