From 695e9d4fddfe9fd2ac4f3dfb6a62f5251f05a3f0 Mon Sep 17 00:00:00 2001 From: VeerChaurasia Date: Wed, 28 Aug 2024 17:40:06 +0530 Subject: [PATCH] Implement/Config/Networks.go --- config/networks.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/networks.go b/config/networks.go index 6dc40d9..78e297c 100644 --- a/config/networks.go +++ b/config/networks.go @@ -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")