Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/hyperdrive 2.0 module #49

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

huy-nodeset
Copy link
Contributor

No description provided.

Comment on lines +187 to +212
func (c *HyperdriveClient) LoadBackupConfig() (*GlobalConfig, error) {
settingsFilePath := filepath.Join(c.Context.UserDirPath, BackupSettingsFile)
expandedPath, err := homedir.Expand(settingsFilePath)
if err != nil {
return nil, fmt.Errorf("error expanding backup settings file path: %w", err)
}

return LoadConfigFromFile(expandedPath, c.Context.HyperdriveNetworkSettings, c.Context.StakeWiseNetworkSettings)
}

// Save the config
func (c *HyperdriveClient) SaveConfig(cfg *GlobalConfig) error {
settingsFileDirectoryPath, err := homedir.Expand(c.Context.UserDirPath)
if err != nil {
return err
}
err = SaveConfig(cfg, settingsFileDirectoryPath, SettingsFile)
if err != nil {
return fmt.Errorf("error saving config: %w", err)
}

// Update the client's config cache
c.cfg = cfg
c.isNewCfg = false
return nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prob dont need any of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant