From 5e6e1f2b97e4aa4630242fd067a9380a44c05748 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Tue, 17 Sep 2024 19:06:00 +0200 Subject: [PATCH] rename dir to tests --- eth/tracers/live/supply_test.go | 12 ++++++------ .../{testdata => tests}/supply/eip1559_burn.json | 0 .../{testdata => tests}/supply/genesis_alloc.json | 0 .../{testdata => tests}/supply/omitted_fields.json | 0 .../{testdata => tests}/supply/selfdestruct.json | 0 .../supply/selfdestruct_itself_and_revert.json | 0 .../live/{testdata => tests}/supply/withdrawals.json | 0 .../live/{testdata => tests}/supply_filler.go | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename eth/tracers/live/{testdata => tests}/supply/eip1559_burn.json (100%) rename eth/tracers/live/{testdata => tests}/supply/genesis_alloc.json (100%) rename eth/tracers/live/{testdata => tests}/supply/omitted_fields.json (100%) rename eth/tracers/live/{testdata => tests}/supply/selfdestruct.json (100%) rename eth/tracers/live/{testdata => tests}/supply/selfdestruct_itself_and_revert.json (100%) rename eth/tracers/live/{testdata => tests}/supply/withdrawals.json (100%) rename eth/tracers/live/{testdata => tests}/supply_filler.go (99%) diff --git a/eth/tracers/live/supply_test.go b/eth/tracers/live/supply_test.go index 4f4dd6e749..b6bbb292ec 100644 --- a/eth/tracers/live/supply_test.go +++ b/eth/tracers/live/supply_test.go @@ -35,10 +35,10 @@ func (bt *blockTest) UnmarshalJSON(data []byte) error { } // The tests have been filled using the executable at -// eth/tracers/live/tracetest/supply_filler.go. +// eth/tracers/live/tests/supply_filler.go. func TestSupplyTracerBlockchain(t *testing.T) { - dirPath := "supply" - files, err := os.ReadDir(filepath.Join("testdata", dirPath)) + dirPath := filepath.Join("tests", "supply") + files, err := os.ReadDir(dirPath) if err != nil { t.Fatalf("failed to retrieve tracer test suite: %v", err) } @@ -49,8 +49,8 @@ func TestSupplyTracerBlockchain(t *testing.T) { file := file // capture range variable var testcases map[string]*blockTest var blob []byte - // Call tracer test found, read if from disk - if blob, err = os.ReadFile(filepath.Join("testdata", dirPath, file.Name())); err != nil { + // Tracer test found, read if from disk + if blob, err = os.ReadFile(filepath.Join(dirPath, file.Name())); err != nil { t.Fatalf("failed to read testcase: %v", err) } if err := json.Unmarshal(blob, &testcases); err != nil { @@ -65,7 +65,7 @@ func TestSupplyTracerBlockchain(t *testing.T) { // Load supply tracer tracer, err := newSupply(json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath))) if err != nil { - t.Fatalf("failed to create call tracer: %v", err) + t.Fatalf("failed to create tracer: %v", err) } if err := test.bt.Run(false, "path", false, tracer, nil); err != nil { t.Errorf("failed to run test: %v\n", err) diff --git a/eth/tracers/live/testdata/supply/eip1559_burn.json b/eth/tracers/live/tests/supply/eip1559_burn.json similarity index 100% rename from eth/tracers/live/testdata/supply/eip1559_burn.json rename to eth/tracers/live/tests/supply/eip1559_burn.json diff --git a/eth/tracers/live/testdata/supply/genesis_alloc.json b/eth/tracers/live/tests/supply/genesis_alloc.json similarity index 100% rename from eth/tracers/live/testdata/supply/genesis_alloc.json rename to eth/tracers/live/tests/supply/genesis_alloc.json diff --git a/eth/tracers/live/testdata/supply/omitted_fields.json b/eth/tracers/live/tests/supply/omitted_fields.json similarity index 100% rename from eth/tracers/live/testdata/supply/omitted_fields.json rename to eth/tracers/live/tests/supply/omitted_fields.json diff --git a/eth/tracers/live/testdata/supply/selfdestruct.json b/eth/tracers/live/tests/supply/selfdestruct.json similarity index 100% rename from eth/tracers/live/testdata/supply/selfdestruct.json rename to eth/tracers/live/tests/supply/selfdestruct.json diff --git a/eth/tracers/live/testdata/supply/selfdestruct_itself_and_revert.json b/eth/tracers/live/tests/supply/selfdestruct_itself_and_revert.json similarity index 100% rename from eth/tracers/live/testdata/supply/selfdestruct_itself_and_revert.json rename to eth/tracers/live/tests/supply/selfdestruct_itself_and_revert.json diff --git a/eth/tracers/live/testdata/supply/withdrawals.json b/eth/tracers/live/tests/supply/withdrawals.json similarity index 100% rename from eth/tracers/live/testdata/supply/withdrawals.json rename to eth/tracers/live/tests/supply/withdrawals.json diff --git a/eth/tracers/live/testdata/supply_filler.go b/eth/tracers/live/tests/supply_filler.go similarity index 99% rename from eth/tracers/live/testdata/supply_filler.go rename to eth/tracers/live/tests/supply_filler.go index e14380a613..496e23d01e 100644 --- a/eth/tracers/live/testdata/supply_filler.go +++ b/eth/tracers/live/tests/supply_filler.go @@ -659,7 +659,7 @@ func testSupplyTracer(genesis *core.Genesis, gen func(*core.BlockGen)) ([]supply // Load supply tracer tracer, err := tracers.LiveDirectory.New("supply", json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath))) if err != nil { - return nil, nil, nil, fmt.Errorf("failed to create call tracer: %v", err) + return nil, nil, nil, fmt.Errorf("failed to create tracer: %v", err) } db := rawdb.NewMemoryDatabase()