diff --git a/eth/tracers/live/supply_test.go b/eth/tracers/live/supply_test.go index 5c211fd40e248..c336567e4b6fa 100644 --- a/eth/tracers/live/supply_test.go +++ b/eth/tracers/live/supply_test.go @@ -52,7 +52,7 @@ func (bt *blockTest) UnmarshalJSON(data []byte) error { // The tests have been filled using the executable at // eth/tracers/live/tests/supply_filler.go. func TestSupplyTracerBlockchain(t *testing.T) { - dirPath := filepath.Join("tests", "supply") + dirPath := filepath.Join("testdata", "supply") files, err := os.ReadDir(dirPath) if err != nil { t.Fatalf("failed to retrieve tracer test suite: %v", err) diff --git a/eth/tracers/live/tests/supply/eip1559_burn.json b/eth/tracers/live/testdata/supply/eip1559_burn.json similarity index 100% rename from eth/tracers/live/tests/supply/eip1559_burn.json rename to eth/tracers/live/testdata/supply/eip1559_burn.json diff --git a/eth/tracers/live/tests/supply/genesis_alloc.json b/eth/tracers/live/testdata/supply/genesis_alloc.json similarity index 100% rename from eth/tracers/live/tests/supply/genesis_alloc.json rename to eth/tracers/live/testdata/supply/genesis_alloc.json diff --git a/eth/tracers/live/tests/supply/omitted_fields.json b/eth/tracers/live/testdata/supply/omitted_fields.json similarity index 100% rename from eth/tracers/live/tests/supply/omitted_fields.json rename to eth/tracers/live/testdata/supply/omitted_fields.json diff --git a/eth/tracers/live/tests/supply/selfdestruct.json b/eth/tracers/live/testdata/supply/selfdestruct.json similarity index 100% rename from eth/tracers/live/tests/supply/selfdestruct.json rename to eth/tracers/live/testdata/supply/selfdestruct.json diff --git a/eth/tracers/live/tests/supply/selfdestruct_itself_and_revert.json b/eth/tracers/live/testdata/supply/selfdestruct_itself_and_revert.json similarity index 100% rename from eth/tracers/live/tests/supply/selfdestruct_itself_and_revert.json rename to eth/tracers/live/testdata/supply/selfdestruct_itself_and_revert.json diff --git a/eth/tracers/live/tests/supply/withdrawals.json b/eth/tracers/live/testdata/supply/withdrawals.json similarity index 100% rename from eth/tracers/live/tests/supply/withdrawals.json rename to eth/tracers/live/testdata/supply/withdrawals.json diff --git a/eth/tracers/live/tests/supply_filler.go b/eth/tracers/live/testdata/supply_filler.go similarity index 98% rename from eth/tracers/live/tests/supply_filler.go rename to eth/tracers/live/testdata/supply_filler.go index 76ec9f909e44f..cfe983f5d14de 100644 --- a/eth/tracers/live/tests/supply_filler.go +++ b/eth/tracers/live/testdata/supply_filler.go @@ -21,6 +21,7 @@ import ( "bytes" "encoding/json" "fmt" + "log/slog" "math/big" "os" "path" @@ -137,7 +138,7 @@ func fillSupplyOmittedFields(path string) error { if err := compareAsJSON(expected, out); err != nil { return err } - if err := writeArtifact(filepath.Join(path, "omitted_fields.json"), "omitted_fields_cancun", db, chain, expected, nil); err != nil { + if err := writeArtefact(filepath.Join(path, "omitted_fields.json"), "omitted_fields_cancun", db, chain, expected, nil); err != nil { return err } return nil @@ -183,7 +184,7 @@ func fillSupplyGenesisAlloc(path string) error { if err := compareAsJSON(expected, out); err != nil { return err } - if err := writeArtifact(filepath.Join(path, "genesis_alloc.json"), "genesis_alloc_grayGlacier", db, chain, expected, nil); err != nil { + if err := writeArtefact(filepath.Join(path, "genesis_alloc.json"), "genesis_alloc_grayGlacier", db, chain, expected, nil); err != nil { return err } return nil @@ -255,7 +256,7 @@ func fillSupplyEip1559Burn(path string) error { if err := compareAsJSON(expected, out); err != nil { return err } - if err := writeArtifact(filepath.Join(path, "eip1559_burn.json"), "eip1559_burn_grayGlacier", db, chain, expected, nil); err != nil { + if err := writeArtefact(filepath.Join(path, "eip1559_burn.json"), "eip1559_burn_grayGlacier", db, chain, expected, nil); err != nil { return err } return nil @@ -302,7 +303,7 @@ func fillSupplyWithdrawals(path string) error { if err := compareAsJSON(expected, out); err != nil { return err } - if err := writeArtifact(filepath.Join(path, "withdrawals.json"), "withdrawals_cancun", db, chain, expected, nil); err != nil { + if err := writeArtefact(filepath.Join(path, "withdrawals.json"), "withdrawals_cancun", db, chain, expected, nil); err != nil { return err } return nil @@ -636,7 +637,7 @@ func fillSupplySelfdestructItselfAndRevert(path string) error { if err := compareAsJSON(expected, output); err != nil { return err } - if err := writeArtifact(filepath.Join(path, "selfdestruct_itself_and_revert.json"), "selfdestruct_itself_and_revert_grayGlacier", db, chain, expected, nil); err != nil { + if err := writeArtefact(filepath.Join(path, "selfdestruct_itself_and_revert.json"), "selfdestruct_itself_and_revert_grayGlacier", db, chain, expected, nil); err != nil { return err } return nil @@ -717,7 +718,7 @@ func compareAsJSON(expected interface{}, actual interface{}) error { return nil } -func writeArtifact(path, name string, db ethdb.Database, chain *core.BlockChain, expected []supplyInfo, post *types.GenesisAlloc) error { +func writeArtefact(path, name string, db ethdb.Database, chain *core.BlockChain, expected []supplyInfo, post *types.GenesisAlloc) error { bt, err := btFromChain(db, chain, post) if err != nil { return fmt.Errorf("failed to fill tests from chain: %v", err) @@ -739,6 +740,7 @@ func writeBTs(path string, tests map[string]*blockTest) error { if err := os.WriteFile(path, enc, 0644); err != nil { return fmt.Errorf("failed to write test to file: %v", err) } + slog.Info("Wrote artefact", "file", path) return nil }