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.
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
refactor(genutil): Use sdk types genesis validator #21678
refactor(genutil): Use sdk types genesis validator #21678
Changes from 39 commits
fddadd3
41c5520
219213b
794ecbc
252f50f
0033996
ed34222
17a42a3
6bb526b
f9aa48b
389b7b8
5775c9f
85a753e
5fe570c
5b31f47
dd2a634
fba3f54
05fe687
e4f1972
80a92ae
fb41419
d0f9f1c
7a7c42a
ddf3149
7c0ce57
641164f
bbb3b01
5d02a84
e9e27f6
cebc09d
a0d41c9
7075a3d
d1f59d2
528606f
b5abb09
29156ed
b1924fd
bb2d7f1
8937cb7
b4014f3
bae84ba
e1a6b0c
76ab968
33e0432
6a81119
496627d
f0c5509
e7600cd
2d40cef
7879361
ebbf3e2
9ddc128
687866d
9b397f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
🛠️ Refactor suggestion
Consider adding error handling for unknown key types.
The
Address()
method implementation looks good overall and follows the Uber Golang style guide. However, it might be beneficial to add error handling for unknown key types.Consider updating the
Address()
method to return an error for unknown key types:This change would allow callers to handle unknown key types more gracefully.
📝 Committable suggestion
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.
i couldn't find other way to get bonded validator directly because of
executionContext
. Dont know if i missed something hereThere 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.
We can use the staking keeper directly and remove this, like in export v1.
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.
can't we pass the correct context from the calling func?
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.
Tip
Codebase Verification
Update remaining
cmttypes.GenesisValidator
usages for consistencyThe verification process has identified several instances where
cmttypes.GenesisValidator
is still being used in the codebase. These occurrences need to be addressed to maintain consistency with the change tosdk.GenesisValidator
in theExportedApp
struct:cmttypes.GenesisValidator
usageAction items:
sdk.GenesisValidator
instead ofcmttypes.GenesisValidator
.Analysis chain
Verify compatibility with existing code.
The change from
cmttypes.GenesisValidator
tosdk.GenesisValidator
aligns with the shift towards using Cosmos SDK types for theValidators
structure. This modification is likely part of a larger refactor to integrate more closely with the Cosmos SDK.However, it's important to ensure that existing code relying on the
cmttypes.GenesisValidator
type is updated to handle the newsdk.GenesisValidator
type to maintain compatibility and functionality related to validator management.Run the following script to identify instances of
cmttypes.GenesisValidator
usage in the codebase:If the script returns instances of
cmttypes.GenesisValidator
usage outside of test files or comments, update the code to handle the newsdk.GenesisValidator
type accordingly.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 287
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.
Why not using the keeper directly?
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.
hmmmm i tried but got
panic: failed to get executionContext from context
in simapp v2 test, seems like i have to use stf to set it inThere 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.
It looks like the input argument to this func
jailAllowedAddrs []string
is not used anywhere, should there be filtering done somewhere in this func?This file was deleted.