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

EditValidator command do not support min-self-delegation #4763

Closed
4 tasks
whunmr opened this issue Jul 23, 2019 · 4 comments · Fixed by #4764
Closed
4 tasks

EditValidator command do not support min-self-delegation #4763

whunmr opened this issue Jul 23, 2019 · 4 comments · Fixed by #4764
Assignees

Comments

@whunmr
Copy link

whunmr commented Jul 23, 2019

Summary of Bug

EditValidator command do not support flag --min-self-delegation

Version

1536f96e8b64707f859e0f54c028c922e6532c5d
Fri Jul 19 15:47:58 2019 +0100
master

Steps to Reproduce

$ gaiacli tx staking edit-validator --min-self-delegation=1000000  --from=validator --chain-id=test

ERROR: unknown flag: --min-self-delegation

fix

Add flagset in code of GetCmdEditValidator:

	cmd.Flags().AddFlagSet(FsMinSelfDelegation)

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

This is intentional -- a validator cannot change this value once created. Choose wisely ;-)

@whunmr
Copy link
Author

whunmr commented Jul 24, 2019

Thanks, got it. @alexanderbez

Maybe then we do not need the related code in func GetCmdEditValidator any more.

			var newMinSelfDelegation *sdk.Int

			minSelfDelegationString := viper.GetString(FlagMinSelfDelegation)
			if minSelfDelegationString != "" {
				msb, ok := sdk.NewIntFromString(minSelfDelegationString)
				if !ok {
					return fmt.Errorf(types.ErrMinSelfDelegationInvalid(types.DefaultCodespace).Error())
				}
				newMinSelfDelegation = &msb
			}

whunmr added a commit to coinexchain/dex that referenced this issue Jul 24, 2019
@alexanderbez
Copy link
Contributor

Ahhh great catch @whunmr! Indeed we do allow it to change, but only increase:

		if !(*msg.MinSelfDelegation).GT(validator.MinSelfDelegation) {
			return ErrMinSelfDelegationDecreased(k.Codespace()).Result()
		}

@fedekunze apologies. Do you mind re-opening the PR?

@alexanderbez alexanderbez reopened this Jul 24, 2019
@fedekunze
Copy link
Collaborator

reopened

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

Successfully merging a pull request may close this issue.

3 participants