Skip to content

Commit

Permalink
Implement/Config/Networks.go
Browse files Browse the repository at this point in the history
  • Loading branch information
VeerChaurasia committed Aug 28, 2024
1 parent c71b799 commit 695e9d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions config/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ func (n Network) chainID(s string) (uint64, error) {
return 0, errors.New("network not recognized")
}
}
func dataDir(network Network) string {
homeDir, err := os.UserHomeDir()
if err != nil {
return fmt.Errorf("failed to get user home directory: %w", err)
}
path := filepath.Join(homeDir, fmt.Sprintf("selene/data/%s", strings.ToLower(string(network))))
return path
func dataDir(network Network) (string, error) {
homeDir, err := os.UserHomeDir()
if err != nil {
return "", fmt.Errorf("failed to get user home directory: %w", err)
}
path := filepath.Join(homeDir, fmt.Sprintf("selene/data/%s", strings.ToLower(string(network))))
return path, nil
}
func Mainnet() (BaseConfig, error) {
defaultCheckpoint, err := common.Hex_str_to_bytes("c7fc7b2f4b548bfc9305fa80bc1865ddc6eea4557f0a80507af5dc34db7bd9ce")
Expand Down

0 comments on commit 695e9d4

Please sign in to comment.