From b31cd160fe351cde8501dc36173234021a68d93f Mon Sep 17 00:00:00 2001 From: RiceChuan Date: Sat, 14 Dec 2024 20:49:47 +0800 Subject: [PATCH] chore: use errors.New to replace fmt.Errorf with no parameters Signed-off-by: RiceChuan --- rollup/internal/controller/sender/transaction_signer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rollup/internal/controller/sender/transaction_signer.go b/rollup/internal/controller/sender/transaction_signer.go index 68305afb3..1b69224a4 100644 --- a/rollup/internal/controller/sender/transaction_signer.go +++ b/rollup/internal/controller/sender/transaction_signer.go @@ -2,6 +2,7 @@ package sender import ( "context" + "errors" "fmt" "math/big" @@ -51,7 +52,7 @@ func NewTransactionSigner(config *config.SignerConfig, chainID *big.Int) (*Trans }, nil case RemoteSignerType: if config.RemoteSignerConfig.SignerAddress == "" { - return nil, fmt.Errorf("failed to create RemoteSigner, signer address is empty") + return nil, errors.New("failed to create RemoteSigner, signer address is empty") } rpcClient, err := rpc.Dial(config.RemoteSignerConfig.RemoteSignerUrl) if err != nil { @@ -94,7 +95,7 @@ func (ts *TransactionSigner) SignTransaction(ctx context.Context, tx *gethTypes. return signedTx, nil default: // this shouldn't happen, because SignerType is checked during creation - return nil, fmt.Errorf("shouldn't happen, unknown signer type") + return nil, errors.New("shouldn't happen, unknown signer type") } }