rename dir to tests

pull/30451/head
Sina Mahmoodi 2 months ago
parent 0853f3b890
commit 5e6e1f2b97
  1. 12
      eth/tracers/live/supply_test.go
  2. 0
      eth/tracers/live/tests/supply/eip1559_burn.json
  3. 0
      eth/tracers/live/tests/supply/genesis_alloc.json
  4. 0
      eth/tracers/live/tests/supply/omitted_fields.json
  5. 0
      eth/tracers/live/tests/supply/selfdestruct.json
  6. 0
      eth/tracers/live/tests/supply/selfdestruct_itself_and_revert.json
  7. 0
      eth/tracers/live/tests/supply/withdrawals.json
  8. 2
      eth/tracers/live/tests/supply_filler.go

@ -35,10 +35,10 @@ func (bt *blockTest) UnmarshalJSON(data []byte) error {
} }
// The tests have been filled using the executable at // 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) { func TestSupplyTracerBlockchain(t *testing.T) {
dirPath := "supply" dirPath := filepath.Join("tests", "supply")
files, err := os.ReadDir(filepath.Join("testdata", dirPath)) files, err := os.ReadDir(dirPath)
if err != nil { if err != nil {
t.Fatalf("failed to retrieve tracer test suite: %v", err) t.Fatalf("failed to retrieve tracer test suite: %v", err)
} }
@ -49,8 +49,8 @@ func TestSupplyTracerBlockchain(t *testing.T) {
file := file // capture range variable file := file // capture range variable
var testcases map[string]*blockTest var testcases map[string]*blockTest
var blob []byte var blob []byte
// Call tracer test found, read if from disk // Tracer test found, read if from disk
if blob, err = os.ReadFile(filepath.Join("testdata", dirPath, file.Name())); err != nil { if blob, err = os.ReadFile(filepath.Join(dirPath, file.Name())); err != nil {
t.Fatalf("failed to read testcase: %v", err) t.Fatalf("failed to read testcase: %v", err)
} }
if err := json.Unmarshal(blob, &testcases); err != nil { if err := json.Unmarshal(blob, &testcases); err != nil {
@ -65,7 +65,7 @@ func TestSupplyTracerBlockchain(t *testing.T) {
// Load supply tracer // Load supply tracer
tracer, err := newSupply(json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath))) tracer, err := newSupply(json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath)))
if err != nil { 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 { if err := test.bt.Run(false, "path", false, tracer, nil); err != nil {
t.Errorf("failed to run test: %v\n", err) t.Errorf("failed to run test: %v\n", err)

@ -659,7 +659,7 @@ func testSupplyTracer(genesis *core.Genesis, gen func(*core.BlockGen)) ([]supply
// Load supply tracer // Load supply tracer
tracer, err := tracers.LiveDirectory.New("supply", json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath))) tracer, err := tracers.LiveDirectory.New("supply", json.RawMessage(fmt.Sprintf(`{"path":"%s"}`, traceOutputPath)))
if err != nil { 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() db := rawdb.NewMemoryDatabase()
Loading…
Cancel
Save