all: replace fmt.Errorf() with errors.New() if no param required (#29472)
This commit is contained in:
parent
cfc7d06cc9
commit
ed4bc7f27b
2
accounts/external/backend.go
vendored
2
accounts/external/backend.go
vendored
@ -239,7 +239,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
|
||||
args.BlobHashes = tx.BlobHashes()
|
||||
sidecar := tx.BlobTxSidecar()
|
||||
if sidecar == nil {
|
||||
return nil, fmt.Errorf("blobs must be present for signing")
|
||||
return nil, errors.New("blobs must be present for signing")
|
||||
}
|
||||
args.Blobs = sidecar.Blobs
|
||||
args.Commitments = sidecar.Commitments
|
||||
|
@ -102,7 +102,7 @@ func (s *Suite) sendTxs(t *utesting.T, txs []*types.Transaction) error {
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("timed out waiting for txs")
|
||||
return errors.New("timed out waiting for txs")
|
||||
}
|
||||
|
||||
func (s *Suite) sendInvalidTxs(t *utesting.T, txs []*types.Transaction) error {
|
||||
|
@ -439,7 +439,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
|
||||
}
|
||||
|
||||
if alloc == nil {
|
||||
return nil, fmt.Errorf("live blockchain tracer requires genesis alloc to be set")
|
||||
return nil, errors.New("live blockchain tracer requires genesis alloc to be set")
|
||||
}
|
||||
|
||||
bc.logger.OnGenesisBlock(bc.genesisBlock, alloc)
|
||||
|
@ -18,7 +18,6 @@ package era
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
@ -80,7 +79,7 @@ func (it *Iterator) Block() (*types.Block, error) {
|
||||
// Receipts returns the receipts for the iterator's current position.
|
||||
func (it *Iterator) Receipts() (types.Receipts, error) {
|
||||
if it.inner.Receipts == nil {
|
||||
return nil, fmt.Errorf("receipts must be non-nil")
|
||||
return nil, errors.New("receipts must be non-nil")
|
||||
}
|
||||
var receipts types.Receipts
|
||||
err := rlp.Decode(it.inner.Receipts, &receipts)
|
||||
|
@ -75,7 +75,7 @@ type newPayloadResult struct {
|
||||
receipts []*types.Receipt // Receipts collected during construction
|
||||
}
|
||||
|
||||
// generateParams wraps various of settings for generating sealing task.
|
||||
// generateParams wraps various settings for generating sealing task.
|
||||
type generateParams struct {
|
||||
timestamp uint64 // The timestamp for sealing task
|
||||
forceTime bool // Flag whether the given timestamp is immutable or not
|
||||
@ -131,7 +131,7 @@ func (miner *Miner) prepareWork(genParams *generateParams) (*environment, error)
|
||||
if genParams.parentHash != (common.Hash{}) {
|
||||
block := miner.chain.GetBlockByHash(genParams.parentHash)
|
||||
if block == nil {
|
||||
return nil, fmt.Errorf("missing parent")
|
||||
return nil, errors.New("missing parent")
|
||||
}
|
||||
parent = block.Header()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user