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 }