go-ethereum/eth/tracers/internal/tracetest
Daniel Liu af69d382ff
eth/tracers: various fixes #30540 (#1491)
Breaking changes:

- The ChainConfig was exposed to tracers via VMContext passed in
`OnTxStart`. This is unnecessary specially looking through the lens of
live tracers as chain config remains the same throughout the lifetime of
the program. It was there so that native API-invoked tracers could
access it. So instead we moved it to the constructor of API tracers.

Non-breaking:

- Change the default config of the tracers to be `{}` instead of nil.
This way an extra nil check can be avoided.

Refactoring:

- Rename `supply` struct to `supplyTracer`.
- Un-export some hook definitions.

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-09-17 09:04:38 +08:00
..
testdata eth/tracers: add disableCode/Storage options for prestateTracer #30648 (#1498) 2025-09-17 08:22:13 +08:00
calltrace_test.go eth/tracers: various fixes #30540 (#1491) 2025-09-17 09:04:38 +08:00
flat_calltrace_test.go eth/tracers: various fixes #30540 (#1491) 2025-09-17 09:04:38 +08:00
makeTest.js eth/tracers/internal/tracetest: include tracerConfig in created tracing test #30364 (#1487) 2025-09-13 10:50:55 +08:00
prestate_test.go eth/tracers: various fixes #30540 (#1491) 2025-09-17 09:04:38 +08:00
README.md eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
util.go eth/tracers: fix issues with benchmarks #30667 (#1500) 2025-09-17 08:18:51 +08:00

Filling test cases

To fill test cases for the built-in tracers, the makeTest.js script can be used. Given a transaction on a dev/test network, makeTest.js will fetch its prestate and then traces with the given configuration. In the Geth console do:

let tx = '0x...'
loadScript('makeTest.js')
makeTest(tx, { tracer: 'callTracer' })