diff --git a/accounts/external/backend.go b/accounts/external/backend.go index 0b336448fc..62322753da 100644 --- a/accounts/external/backend.go +++ b/accounts/external/backend.go @@ -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 diff --git a/cmd/devp2p/internal/ethtest/transaction.go b/cmd/devp2p/internal/ethtest/transaction.go index 80b5d80745..cbbbbce8d9 100644 --- a/cmd/devp2p/internal/ethtest/transaction.go +++ b/cmd/devp2p/internal/ethtest/transaction.go @@ -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 { diff --git a/core/blockchain.go b/core/blockchain.go index 6808753734..fa112c2503 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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) diff --git a/internal/era/iterator.go b/internal/era/iterator.go index d90e9586a4..cc4f27c201 100644 --- a/internal/era/iterator.go +++ b/internal/era/iterator.go @@ -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) diff --git a/miner/worker.go b/miner/worker.go index 9f8d9f663f..4924952478 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -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() }