-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix(x/staking): make metadata nullable #22556
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5cc08df
fix(x/staking): make metadata nullable
julienrbrt a4a5a6b
cl
julienrbrt f4d6a37
fix
julienrbrt cc6c67b
Merge branch 'main' into julien/nullable
julienrbrt accb7ec
build
julienrbrt 09e8221
fix isEmpty
julienrbrt 826779d
updates
julienrbrt 3313e2b
Merge branch 'main' into julien/nullable
julienrbrt 6edb300
updates
julienrbrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
💡 Codebase verification
Several test files need to be updated to use pointer metadata
The
NewDescription
function inx/staking/types/validator.go
expects a pointer*Metadata
, but some test files are still passing value types. The following locations need to be updated to use&stakingtypes.Metadata{}
:tests/integration/slashing/slashing_test.go
:stakingtypes.NewDescription("foo_moniker", "", "", "", "", stakingtypes.Metadata{})
tests/integration/staking/keeper/msg_server_test.go
:types.NewDescription("Validator", "", "", "", "", types.Metadata{})
tests/integration/staking/keeper/genesis_test.go
: Multiple occurrences oftypes.NewDescription(..., types.Metadata{})
tests/integration/gov/common_test.go
:stakingtypes.NewDescription("T", "E", "S", "T", "Z", stakingtypes.Metadata{})
simapp/simd/cmd/testnet.go
:stakingtypes.NewDescription(nodeDirName, "", "", "", "", stakingtypes.Metadata{})
🔗 Analysis chain
LGTM! Change aligns with making metadata nullable.
The modification to use a pointer for metadata aligns with the PR objective of making the field nullable, which helps avoid the need for validator migrations.
Let's verify that this change doesn't break existing tests:
The search results show that there are several test files and simulation code using
NewDescription
with metadata. I notice that some files are already using a pointer (&stakingtypes.Metadata{}
), while others are using value types (stakingtypes.Metadata{}
). Let's verify if theNewDescription
function signature has been updated to expect a pointer consistently.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 6401
Script:
Length of output: 708