-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update SoV struct to align with latest ACP-77 spec #3492
Conversation
|
||
// validateConstants returns true if the constants of this validator have not | ||
// been modified. | ||
func (v SubnetOnlyValidator) validateConstants(o SubnetOnlyValidator) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action required) Maybe rename to something more descriptive/a question answered by a boolean (e.g. constantsAreUnmodified
)?
Also, is this method intended going to be used by non-test code in subsequent PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this helper is used is later PRs
} | ||
return vdr, err | ||
return vdr, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action required) 😄
} | ||
} | ||
|
||
func TestSubnetOnlyValidator_validateConstants(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action required) As much as I like test tables, maybe it would be easier to maintain a procedural approach that modified the parameter to validateConstants field-by-field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally lgtm, just few nits that maru already mentioned.
Why this should be merged
Factored out of #3388.
How this works
RemainingBalanceOwner
DeactivationOwner
EndAccumulatedFee == 0
implies inactiveCompare
ontoSubnetOnlyValidator
SubnetOnlyValidator
s by value rather than reference so that modifying them can be done without changing the original valueHow this was tested