mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
PR: Part 3
This commit is contained in:
parent
42aa31c867
commit
0d26c9a9b7
2 changed files with 13 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ package firehose_test
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/eth/tracers"
|
||||
"math/big"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
|
@ -49,7 +50,11 @@ func TestFirehosePrestate(t *testing.T) {
|
|||
|
||||
for _, model := range tracingModels {
|
||||
t.Run(fmt.Sprintf("%s/%s/%s", model, name, concurrencyLabel), func(t *testing.T) {
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, concurrent)
|
||||
config := &tracers.FirehoseConfig{
|
||||
ConcurrentBlockFlushing: concurrent,
|
||||
}
|
||||
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, config)
|
||||
defer onClose()
|
||||
|
||||
runPrestateBlock(t, filepath.Join(folder, "prestate.json"), tracingHooks)
|
||||
|
|
@ -202,7 +207,11 @@ func testBlockTracesCorrectly(t *testing.T, genesisSpec *core.Genesis, engine co
|
|||
|
||||
for _, model := range tracingModels {
|
||||
t.Run(fmt.Sprintf("%s/%s", model, concurrencyLabel), func(t *testing.T) {
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, concurrent)
|
||||
config := &tracers.FirehoseConfig{
|
||||
ConcurrentBlockFlushing: concurrent,
|
||||
}
|
||||
|
||||
tracer, tracingHooks, onClose := newFirehoseTestTracer(t, model, config)
|
||||
defer onClose()
|
||||
|
||||
chain, err := core.NewBlockChain(rawdb.NewMemoryDatabase(), nil, genesisSpec, nil, engine, vm.Config{Tracer: tracingHooks}, nil)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type firehoseInitLine struct {
|
|||
|
||||
type firehoseBlockLines []firehoseBlockLine
|
||||
|
||||
func newFirehoseTestTracer(t *testing.T, model tracingModel, concurrentBlockFlushing bool) (*tracers.Firehose, *tracing.Hooks, func()) {
|
||||
func newFirehoseTestTracer(t *testing.T, model tracingModel, config *tracers.FirehoseConfig) (*tracers.Firehose, *tracing.Hooks, func()) {
|
||||
t.Helper()
|
||||
|
||||
tracer, err := tracers.NewFirehoseFromRawJSON([]byte(fmt.Sprintf(`{
|
||||
|
|
@ -39,7 +39,7 @@ func newFirehoseTestTracer(t *testing.T, model tracingModel, concurrentBlockFlus
|
|||
"ignoreGenesisBlock": true,
|
||||
"forcedBackwardCompatibility": %t
|
||||
}
|
||||
}`, concurrentBlockFlushing, model == tracingModelFirehose2_3)))
|
||||
}`, config.ConcurrentBlockFlushing, model == tracingModelFirehose2_3)))
|
||||
require.NoError(t, err)
|
||||
|
||||
hooks := tracers.NewTracingHooksFromFirehose(tracer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue