From 0085c2055e9c7a2c304bdc155d9e6deceb8f6443 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:24:14 +0900 Subject: [PATCH 1/9] eth/catalyst: fix error string format --- eth/catalyst/api_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index 0586959f0633..64e6684be155 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -979,11 +979,11 @@ func TestSimultaneousNewBlock(t *testing.T) { defer wg.Done() if newResp, err := api.NewPayloadV1(*execData); err != nil { errMu.Lock() - testErr = fmt.Errorf("Failed to insert block: %w", err) + testErr = fmt.Errorf("failed to insert block: %w", err) errMu.Unlock() } else if newResp.Status != "VALID" { errMu.Lock() - testErr = fmt.Errorf("Failed to insert block: %v", newResp.Status) + testErr = fmt.Errorf("failed to insert block: %v", newResp.Status) errMu.Unlock() } }() @@ -1018,7 +1018,7 @@ func TestSimultaneousNewBlock(t *testing.T) { defer wg.Done() if _, err := api.ForkchoiceUpdatedV1(fcState, nil); err != nil { errMu.Lock() - testErr = fmt.Errorf("Failed to insert block: %w", err) + testErr = fmt.Errorf("failed to insert block: %w", err) errMu.Unlock() } }() From 29d94fea3272b0fcd735b88997909fbdc82c451e Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:25:08 +0900 Subject: [PATCH 2/9] eth: fix error string format --- eth/backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/backend.go b/eth/backend.go index e616b5f2f195..97e68b8cf01c 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -208,7 +208,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { } t, err := tracers.LiveDirectory.New(config.VMTrace, traceConfig) if err != nil { - return nil, fmt.Errorf("Failed to create tracer %s: %v", config.VMTrace, err) + return nil, fmt.Errorf("failed to create tracer %s: %v", config.VMTrace, err) } vmConfig.Tracer = t } From 37f571137153a4fa9198821c1733f1b165aeaca3 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:26:03 +0900 Subject: [PATCH 3/9] core: fix error string format --- core/chain_indexer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/chain_indexer_test.go b/core/chain_indexer_test.go index f09960901558..bf3bde756cb9 100644 --- a/core/chain_indexer_test.go +++ b/core/chain_indexer_test.go @@ -228,7 +228,7 @@ func (b *testChainIndexBackend) Process(ctx context.Context, header *types.Heade b.t.Error("Unexpected call to Process") // Can't use Fatal since this is not the test's goroutine. // Returning error stops the chainIndexer's updateLoop - return errors.New("Unexpected call to Process") + return errors.New("unexpected call to Process") case b.processCh <- header.Number.Uint64(): } return nil From 081058a85efbcbd4be7f34a2583ca0601a91feb5 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:26:27 +0900 Subject: [PATCH 4/9] beacon/types: fix error string format --- beacon/types/exec_payload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon/types/exec_payload.go b/beacon/types/exec_payload.go index 4448f854ad12..b159687dfcc5 100644 --- a/beacon/types/exec_payload.go +++ b/beacon/types/exec_payload.go @@ -65,7 +65,7 @@ func convertPayload[T payloadType](payload T, parentRoot *zrntcommon.Root) (*typ block := types.NewBlockWithHeader(&header).WithBody(types.Body{Transactions: transactions, Withdrawals: withdrawals}) if hash := block.Hash(); hash != expectedHash { - return nil, fmt.Errorf("Sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash) + return nil, fmt.Errorf("sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash) } return block, nil } From 3d852a4d37426c56aa97e105b841c35851a08f9a Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:28:26 +0900 Subject: [PATCH 5/9] log: fix error string format --- log/logger_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/logger_test.go b/log/logger_test.go index 2ea08585475d..114ed8d800fd 100644 --- a/log/logger_test.go +++ b/log/logger_test.go @@ -97,7 +97,7 @@ func benchmarkLogger(b *testing.B, l Logger) { tt = time.Now() bigint = big.NewInt(100) nilbig *big.Int - err = errors.New("Oh nooes it's crap") + err = errors.New("oh nooes it's crap") ) b.ReportAllocs() b.ResetTimer() @@ -126,7 +126,7 @@ func TestLoggerOutput(t *testing.T) { tt = time.Time{} bigint = big.NewInt(100) nilbig *big.Int - err = errors.New("Oh nooes it's crap") + err = errors.New("oh nooes it's crap") smallUint = uint256.NewInt(500_000) bigUint = &uint256.Int{0xff, 0xff, 0xff, 0xff} ) From a57c527114d3dde5c53eb77be1329d30abb2c5d6 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:28:54 +0900 Subject: [PATCH 6/9] cmd/clef: fix error string format --- cmd/clef/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index f9b00e4a12a0..18338c5691b4 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -552,7 +552,7 @@ func listWallets(c *cli.Context) error { // accountImport imports a raw hexadecimal private key via CLI. func accountImport(c *cli.Context) error { if c.Args().Len() != 1 { - return errors.New(" must be given as first argument.") + return errors.New(" must be given as first argument") } internalApi, ui, err := initInternalApi(c) if err != nil { @@ -583,7 +583,7 @@ func accountImport(c *cli.Context) error { } if first != second { //lint:ignore ST1005 This is a message for the user - return errors.New("Passwords do not match") + return errors.New("passwords do not match") } acc, err := internalApi.ImportRawKey(hex.EncodeToString(crypto.FromECDSA(pKey)), first) if err != nil { From 6a52162ce3ad481b99a677f1b1ed4bad8780fa13 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 16:29:35 +0900 Subject: [PATCH 7/9] core/types: fix error string format --- core/types/transaction_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/types/transaction_test.go b/core/types/transaction_test.go index 361b977611c2..5dbf367073b5 100644 --- a/core/types/transaction_test.go +++ b/core/types/transaction_test.go @@ -379,7 +379,7 @@ func assertEqual(orig *Transaction, cpy *Transaction) error { } if orig.AccessList() != nil { if !reflect.DeepEqual(orig.AccessList(), cpy.AccessList()) { - return errors.New("access list wrong!") + return errors.New("access list wrong") } } return nil From fec649a07a833f663c2586c97d0b7e187b1b23d8 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 17:26:54 +0900 Subject: [PATCH 8/9] cmd/clef, log: fix testcodes --- cmd/clef/consolecmd_test.go | 2 +- log/logger_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/clef/consolecmd_test.go b/cmd/clef/consolecmd_test.go index c8b37f5b92ee..abdefce174c4 100644 --- a/cmd/clef/consolecmd_test.go +++ b/cmd/clef/consolecmd_test.go @@ -48,7 +48,7 @@ func TestImportRaw(t *testing.T) { // Run clef importraw clef := runClef(t, "--suppress-bootwarn", "--lightkdf", "importraw", keyPath) clef.input("myverylongpassword1").input("myverylongpassword2").WaitExit() - if have, want := clef.StderrText(), "Passwords do not match\n"; have != want { + if have, want := clef.StderrText(), "passwords do not match\n"; have != want { t.Errorf("have %q, want %q", have, want) } }) diff --git a/log/logger_test.go b/log/logger_test.go index 114ed8d800fd..6f415eb471d2 100644 --- a/log/logger_test.go +++ b/log/logger_test.go @@ -150,7 +150,7 @@ func TestLoggerOutput(t *testing.T) { have := out.String() t.Logf("output %v", out.String()) - want := `INFO [11-07|19:14:33.821] This is a message foo=123 bytes="[0 0 0 0 0 0 0 0 0 0]" bonk="a string with text" time=0001-01-01T00:00:00+0000 bigint=100 nilbig= err="Oh nooes it's crap" struct="{A:Foo B:12}" struct="{A:Foo\nLinebreak B:122}" ptrstruct="&{A:Foo B:12}" smalluint=500,000 bigUint=1,600,660,942,523,603,594,864,898,306,482,794,244,293,965,082,972,225,630,372,095 + want := `INFO [11-07|19:14:33.821] This is a message foo=123 bytes="[0 0 0 0 0 0 0 0 0 0]" bonk="a string with text" time=0001-01-01T00:00:00+0000 bigint=100 nilbig= err="oh nooes it's crap" struct="{A:Foo B:12}" struct="{A:Foo\nLinebreak B:122}" ptrstruct="&{A:Foo B:12}" smalluint=500,000 bigUint=1,600,660,942,523,603,594,864,898,306,482,794,244,293,965,082,972,225,630,372,095 ` if !bytes.Equal([]byte(have)[25:], []byte(want)[25:]) { t.Errorf("Error\nhave: %q\nwant: %q", have, want) From 4af88702dc43b1311f71079e420e9ab33229d479 Mon Sep 17 00:00:00 2001 From: trillom8 Date: Sun, 26 May 2024 22:38:23 +0900 Subject: [PATCH 9/9] cmd/clef: revert error string --- cmd/clef/consolecmd_test.go | 2 +- cmd/clef/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/clef/consolecmd_test.go b/cmd/clef/consolecmd_test.go index abdefce174c4..c8b37f5b92ee 100644 --- a/cmd/clef/consolecmd_test.go +++ b/cmd/clef/consolecmd_test.go @@ -48,7 +48,7 @@ func TestImportRaw(t *testing.T) { // Run clef importraw clef := runClef(t, "--suppress-bootwarn", "--lightkdf", "importraw", keyPath) clef.input("myverylongpassword1").input("myverylongpassword2").WaitExit() - if have, want := clef.StderrText(), "passwords do not match\n"; have != want { + if have, want := clef.StderrText(), "Passwords do not match\n"; have != want { t.Errorf("have %q, want %q", have, want) } }) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 18338c5691b4..88d4c99e785a 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -583,7 +583,7 @@ func accountImport(c *cli.Context) error { } if first != second { //lint:ignore ST1005 This is a message for the user - return errors.New("passwords do not match") + return errors.New("Passwords do not match") } acc, err := internalApi.ImportRawKey(hex.EncodeToString(crypto.FromECDSA(pKey)), first) if err != nil {