rename dir to tests

This commit is contained in:
Sina Mahmoodi 2024-09-17 19:06:00 +02:00 committed by Martin Holst Swende
parent f6f916a1b2
commit 7708267e05
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
8 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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()