go-ethereum/tests
jwasinger f64aa6eaf7
internal/testlog: fix log output from sub-loggers (#31539)
When we instantiate a sub-logger via
`go-ethereum/internal/testlog/logger.With`, we copy the reference to the
`bufHandler` from the parent logger. However, internally,
`go-ethereum/internal/testlog/logger.With` calls `log/slog/Logger.With`
which creates a new handler instance (via
`internal/bufHandler.WithAttrs`).

This PR modifies sub-logger instantiation to use the newly-instantiated
handler, instead of copying the reference from the parent instance. The
type cast from `slog.Handler` to `*bufHandler` in
`internal/testlog/Logger.With` is safe here because a
`internal/testlog/Logger` can only be instantiated with a `*bufHandler`
as the underlying handler type.

Note, that I've also removed a pre-existing method that broke the above
assumption. However, this method is not used in our codebase.

I'm not sure if the assumption holds for forks of geth (e.g. optimism
has modified the testlogger somewhat allowing test loggers to accept
arbitrary handler types), but it seems okay to break API compatibility
given that this is in the `internal` package.

closes https://github.com/ethereum/go-ethereum/issues/31533
2025-04-10 18:21:32 +02:00
..
evm-benchmarks@d8b88f4046 tests: update evm-benchmarks (#26255) 2022-11-28 11:13:41 +01:00
fuzzers eth/fetcher: Fix flaky TestTransactionForgotten test using mock clock (#31468) 2025-04-10 11:26:35 +02:00
solidity all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
testdata@faf33b4714 internal/testlog: fix log output from sub-loggers (#31539) 2025-04-10 18:21:32 +02:00
block_test.go tests: update ethereum/tests to v17.0 (#31381) 2025-03-14 18:53:05 +01:00
block_test_util.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
difficulty_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
difficulty_test_util.go all: add whitespace linter (#25312) 2022-07-25 13:14:03 +03:00
gen_btheader.go build, tests: add execution-spec-tests (#26985) 2023-08-26 15:42:27 +02:00
gen_difficultytest.go all: simplify timestamps to uint64 (#19372) 2019-04-02 23:28:48 +03:00
gen_stauthorization.go core/types: change SetCodeTx.ChainID to uint256 (#30982) 2025-01-14 06:42:18 -07:00
gen_stenv.go tests: add currentExcessBlobGas to state tests (#28735) 2023-12-28 11:39:28 +01:00
gen_sttransaction.go all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
init.go params: add osaka blob schedule (#31174) 2025-02-18 15:03:48 +01:00
init_test.go build: update EEST fixtures to prague devnet-6 (#31088) 2025-02-06 12:33:40 +01:00
rlp_test.go tests: get test name from testing.T (#22941) 2021-05-25 22:47:14 +02:00
rlp_test_util.go internal,tests: replace noarg fmt.Errorf with errors.New (#27335) 2023-05-25 02:54:28 -04:00
state_test.go tests: update ethereum/tests to v17.0 (#31381) 2025-03-14 18:53:05 +01:00
state_test_util.go core/tracing: state journal wrapper (#30441) 2025-02-05 13:58:25 +01:00
transaction_test.go tests: update ethereum/tests to v17.0 (#31381) 2025-03-14 18:53:05 +01:00
transaction_test_util.go tests: update ethereum/tests to v17.0 (#31381) 2025-03-14 18:53:05 +01:00