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

ready-for-review: fixed donotmodify bug #1827

Merged
merged 4 commits into from
Jul 26, 2018
Merged

Conversation

sunnya97
Copy link
Member

@sunnya97 sunnya97 commented Jul 25, 2018

closes #1740

  • Linked to github-issue with discussion and accepted design
  • Updated all relevant documentation (docs/)
  • Updated all relevant code comments
  • Wrote tests
  • Added entries in PENDING.md
  • Updated cmd/gaia and examples/

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@sunnya97 sunnya97 changed the title ready-for-revie: fixed donotmodify bug ready-for-review: fixed donotmodify bug Jul 25, 2018
@@ -271,16 +271,16 @@ func NewDescription(moniker, identity, website, details string) Description {
// UpdateDescription updates the fields of a given description. An error is
// returned if the resulting description contains an invalid length.
func (d Description) UpdateDescription(d2 Description) (Description, sdk.Error) {
if d.Moniker == doNotModifyDescVal {
if d2.Moniker == doNotModifyDescVal {
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the point of this code is that if it is "[do-not-modify]" it can't be altered.

This now allows the description to be modified even if its currently "[do-not-modify]"

This is presuming that d2 is the updated desc (the variable should be renamed regardless imo, to make the code + godoc clearer).

Copy link
Contributor

Choose a reason for hiding this comment

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

@ValarDragon you got it backwards - the point of [do-not-modify] is exclusively for the flag usage, not supposed to ever be stored in actual descriptions. How Sunny modified this here corrects the code to its original intention

d2.Moniker = d.Moniker
}
if d.Identity == doNotModifyDescVal {
if d2.Identity == doNotModifyDescVal {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we export doNotModifyDescVal?

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed no reason for this to be unexported - I can muster up some situations where maybe folks will want access to this

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed

fsDescription.String(FlagMoniker, "", "validator name")
fsDescription.String(FlagIdentity, "", "optional identity signature (ex. UPort or Keybase)")
fsDescription.String(FlagWebsite, "", "optional website")
fsDescription.String(FlagDetails, "", "optional details")
Copy link
Contributor

Choose a reason for hiding this comment

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

This change only makes sense in the context of these flags being used in create-validator. In the context of edit-validator the old default values make sense

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed

Copy link
Member Author

@sunnya97 sunnya97 Jul 26, 2018

Choose a reason for hiding this comment

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

Wait, but if you default it to [do-not-modify], then how do I reset a field to empty using the cli?

Copy link
Contributor

Choose a reason for hiding this comment

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

The default for validator creation is an empty string "", the default for the flags for edit-candidacy is [do-not-modify] which just means that if you do not include the flag, it will not edit the original field you had in there. If you want to reset a field to the empty string then something like gaiacli stake edit-validator --moniker="" should work

Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

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

Thanks

@rigelrozanski rigelrozanski merged commit 9e0f5ac into develop Jul 26, 2018
@rigelrozanski rigelrozanski deleted the sunny/fix-do-not-modify branch July 26, 2018 18:04
@codecov
Copy link

codecov bot commented Jul 26, 2018

Codecov Report

Merging #1827 into develop will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           develop    #1827   +/-   ##
========================================
  Coverage    63.44%   63.44%           
========================================
  Files          117      117           
  Lines         6937     6937           
========================================
  Hits          4401     4401           
  Misses        2281     2281           
  Partials       255      255

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.

Cannot edit validator information
3 participants