Skip to content

Commit 4641fd8

Browse files
authored
fix: setconfig command fails on new vm for the first run of a staker (#1271)
* hotfix: removed getConfigData() call from setConfig command * chore: update version to v2.1.0 * refactor: removed unwanted 'InitializeCommandDependencies()' from import and create command
1 parent 486a93a commit 4641fd8

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

cmd/create.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ func initialiseCreate(cmd *cobra.Command, args []string) {
2828

2929
//This function sets the flags appropriately and executes the Create function
3030
func (*UtilsStruct) ExecuteCreate(flagSet *pflag.FlagSet) {
31-
_, _, _, _, err := InitializeCommandDependencies(flagSet)
32-
utils.CheckError("Error in initialising command dependencies: ", err)
31+
config, err := cmdUtils.GetConfigData()
32+
utils.CheckError("Error in getting config: ", err)
33+
log.Debug("Checking to assign log file...")
34+
fileUtils.AssignLogFile(flagSet, config)
3335
log.Info("The password should be of minimum 8 characters containing least 1 uppercase, lowercase, digit and special character.")
3436
password := razorUtils.AssignPassword(flagSet)
3537
log.Debug("ExecuteCreate: Calling Create() with argument as input password")

cmd/import.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ func initialiseImport(cmd *cobra.Command, args []string) {
2929

3030
//This function sets the flags appropriately and executes the ImportAccount function
3131
func (*UtilsStruct) ExecuteImport(flagSet *pflag.FlagSet) {
32-
_, _, _, _, err := InitializeCommandDependencies(flagSet)
33-
utils.CheckError("Error in initialising command dependencies: ", err)
32+
config, err := cmdUtils.GetConfigData()
33+
utils.CheckError("Error in getting config: ", err)
34+
log.Debug("Checking to assign log file...")
35+
fileUtils.AssignLogFile(flagSet, config)
3436
log.Debug("Calling ImportAccount()...")
3537
account, err := cmdUtils.ImportAccount()
3638
utils.CheckError("Import error: ", err)

cmd/setConfig.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Example:
2929

3030
// This function returns the error if there is any and sets the config
3131
func (*UtilsStruct) SetConfig(flagSet *pflag.FlagSet) error {
32-
_, _, _, _, err := InitializeCommandDependencies(flagSet)
33-
utils.CheckError("Error in initialising command dependencies: ", err)
32+
log.Debug("Checking to assign log file...")
33+
fileUtils.AssignLogFile(flagSet, types.Configurations{})
3434

3535
flagDetails := []types.FlagDetail{
3636
{Name: "provider", Type: "string"},

core/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "fmt"
44

55
const (
66
VersionMajor = 2 // Major version component of the current release
7-
VersionMinor = 0 // Minor version component of the current release
7+
VersionMinor = 1 // Minor version component of the current release
88
VersionPatch = 0 // Patch version component of the current release
99
VersionMeta = "" // Version metadata to append to the version string
1010
)

0 commit comments

Comments
 (0)