Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Builds off #740, with improved validation that checks for keeper fields being nil valued.
Details
Note there's a weird intricacy when calling
reflect.ValueOf(x).IsZero()
, whereValueOf()
returns a zero valuedreflect.Value
ifx
isnil
, which panicsIsZero()
in a way that doesn't print an easily debuggable panic message. This PR doesn't change panicking functionality, but it does ensure that a useful panic message is printed when a keeper field is nil.mustValidateFields
only exists for ease of debugging anyways.Type of change
Refactor
: Changes existing code style, naming, structure, etc.Regression tests
Existing UTs act as regression tests
New behavior tests
n/a
Versioning Implications
If the above box is checked, which version should be bumped?
MAJOR
: Consensus breaking changes to both the provider and consumers(s), including updates/breaking changes to IBC communication between provider and consumer(s)MINOR
: Consensus breaking changes which affect either only the provider or only the consumer(s)PATCH
: Non consensus breaking changesTargeting
Please select one of the following: