ipld-eth-state-snapshot/fixture/chaindata.go
Roy Crihfield 6969595d37
All checks were successful
Test / Run unit and integration tests (pull_request) Successful in 4m44s
rm old todo
2023-09-06 00:45:43 +08:00

25 lines
609 B
Go

package fixture
import (
"os"
"path/filepath"
)
// GetChainDataPath returns the absolute paths to fixture chain data given a name.
// Current chains are at "chaindata", "chain2data".
func GetChainDataPath(chain string) (string, string) {
path := filepath.Join("..", "..", "fixture", chain)
chaindataPath, err := filepath.Abs(path)
if err != nil {
panic("cannot resolve path " + path)
}
ancientdataPath := filepath.Join(chaindataPath, "ancient")
if _, err := os.Stat(chaindataPath); err != nil {
panic("must populate chaindata at " + chaindataPath)
}
return chaindataPath, ancientdataPath
}