-
Notifications
You must be signed in to change notification settings - Fork 200
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: remove all stringer for proto types #1874
Conversation
WalkthroughThe recent changes involve updating string-related methods and imports across various modules, focusing on removing the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (4)
eth/account.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
x/oracle/types/oracle.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
x/sudo/types/state.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
x/tokenfactory/types/state.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
Files selected for processing (19)
- proto/eth/types/v1/account.proto (1 hunks)
- proto/nibiru/oracle/v1/oracle.proto (4 hunks)
- proto/nibiru/sudo/v1/state.proto (1 hunks)
- proto/nibiru/tokenfactory/v1/state.proto (1 hunks)
- x/oracle/types/params.go (2 hunks)
- x/oracle/types/vote.go (5 hunks)
- x/sudo/keeper/msg_server.go (1 hunks)
- x/sudo/types/state.go (2 hunks)
- x/tokenfactory/cli/cli_test.go (1 hunks)
- x/tokenfactory/keeper/genesis.go (1 hunks)
- x/tokenfactory/keeper/genesis_test.go (1 hunks)
- x/tokenfactory/keeper/grpc_query_test.go (2 hunks)
- x/tokenfactory/keeper/msg_server.go (1 hunks)
- x/tokenfactory/keeper/msg_server_test.go (10 hunks)
- x/tokenfactory/keeper/store.go (3 hunks)
- x/tokenfactory/keeper/store_test.go (1 hunks)
- x/tokenfactory/keeper/wasm_test.go (4 hunks)
- x/tokenfactory/types/state.go (2 hunks)
- x/tokenfactory/types/state_test.go (2 hunks)
Files skipped from review due to trivial changes (6)
- proto/eth/types/v1/account.proto
- proto/nibiru/oracle/v1/oracle.proto
- proto/nibiru/sudo/v1/state.proto
- proto/nibiru/tokenfactory/v1/state.proto
- x/oracle/types/params.go
- x/oracle/types/vote.go
Additional comments not posted (26)
x/sudo/types/state.go (1)
Line range hint
1-22
: LGTM! The removal of theString()
method forSudoers
aligns with the PR objective.x/tokenfactory/keeper/store_test.go (1)
34-34
: LGTM! The change fromString()
toPrettyString()
forTFDenom
is consistent with the PR objective.x/tokenfactory/keeper/genesis_test.go (1)
16-16
: LGTM! The change fromString()
toPrettyString()
forTFDenom
is consistent with the PR objective.x/tokenfactory/keeper/genesis.go (2)
39-39
: LGTM! The change fromString()
toPrettyString()
forTFDenom
is consistent with the PR objective.
45-45
: LGTM! The change fromString()
toPrettyString()
forTFDenom
is consistent with the PR objective.x/tokenfactory/keeper/grpc_query_test.go (2)
48-52
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
Ensure consistency in string representation methods.
The verification confirms that
PrettyString()
is consistently used across the codebase forTFDenom
. No instances ofTFDenom{}.String()
were found, andPrettyString()
is used in all relevant places.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom\{\}\.String\(\)'Length of output: 40
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.PrettyString()` usage. # Test: Search for the function usage. Expect: Occurrences of `TFDenom.PrettyString()`. rg --type go 'TFDenom\{\}\.PrettyString\(\)'Length of output: 46
Script:
#!/bin/bash # Description: Verify the definition of `PrettyString()` in the codebase. # Test: Search for the definition of `PrettyString()` in Go files. rg --type go 'func (t TFDenom) PrettyString\(\)'Length of output: 50
Script:
#!/bin/bash # Description: Verify the definition of any method named `PrettyString` in the codebase. # Test: Search for the definition of any method named `PrettyString` in Go files. rg --type go 'func \(\w+ \w+\) PrettyString\(\)'Length of output: 123
Script:
#!/bin/bash # Description: Verify all instances of `PrettyString()` usage in the codebase. # Test: Search for the usage of `PrettyString()` in Go files. rg --type go '\.PrettyString\(\)'Length of output: 3180
94-94
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
All instances of
TFDenom.String()
have been replaced withPrettyString()
.
- No occurrences of
TFDenom.String()
were found in the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom.String()'Length of output: 33
x/tokenfactory/types/state.go (3)
32-32
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
All instances of
TFDenom.String()
have been successfully replaced withPrettyString()
.
- No occurrences of
TFDenom.String()
were found in the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom\.String()'Length of output: 34
36-36
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
Consistency in String Representation Methods Verified
The search results confirm that the
PrettyString()
method is being used consistently across the codebase, replacing the previousString()
method forTFDenom
.
- Instances of
PrettyString()
were found in multiple files, including:
x/tokenfactory/types/state_test.go
x/tokenfactory/types/state.go
x/tokenfactory/keeper/wasm_test.go
x/tokenfactory/keeper/store_test.go
x/tokenfactory/keeper/msg_server.go
x/tokenfactory/keeper/grpc_query_test.go
x/tokenfactory/keeper/genesis_test.go
x/tokenfactory/cli/cli_test.go
x/tokenfactory/keeper/store.go
x/tokenfactory/keeper/msg_server_test.go
This confirms that the transition from
String()
toPrettyString()
has been implemented correctly.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom\{\}\.String\(\)'Length of output: 40
Script:
#!/bin/bash # Description: Verify the presence of `TFDenom.PrettyString()` to ensure it has replaced `String()`. # Test: Search for the function usage. Expect: Occurrences of `TFDenom.PrettyString()`. rg --type go 'TFDenom\{\}\.PrettyString\(\)'Length of output: 46
Script:
#!/bin/bash # Description: Verify the presence of `PrettyString()` to ensure it is being used in the codebase. # Test: Search for the function usage. Expect: Occurrences of `PrettyString()`. rg --type go 'PrettyString\(\)'Length of output: 3251
45-45
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
Consistent Usage of
PrettyString()
VerifiedThe search results confirm that
PrettyString()
is consistently used across the codebase, replacing the previousString()
method forTFDenom
.
- Instances of
PrettyString()
were found in multiple files, including:
x/tokenfactory/types/state.go
x/tokenfactory/keeper/wasm_test.go
x/tokenfactory/keeper/store.go
x/tokenfactory/keeper/msg_server.go
x/tokenfactory/cli/cli_test.go
No occurrences of
TFDenom.String()
were found, indicating that the transition toPrettyString()
is complete.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom.String()'Length of output: 33
Script:
#!/bin/bash # Description: Verify that `TFDenom.PrettyString()` is used consistently across the codebase. # Test: Search for the function usage. Expect: Occurrences of `TFDenom.PrettyString()`. rg --type go 'TFDenom.PrettyString()'Length of output: 39
Script:
#!/bin/bash # Description: Verify that `PrettyString()` is used in the codebase. # Test: Search for any usage of `PrettyString()`. Expect: Occurrences of `PrettyString()`. rg --type go 'PrettyString()'Length of output: 3249
x/sudo/keeper/msg_server.go (1)
92-93
: Ensure proper conversion and string representation.The change from
String()
toToPb().String()
should be verified to ensure it correctly represents theSudoers
struct. Verify thatToPb()
returns a valid protobuf message with a properString()
method.x/tokenfactory/types/state_test.go (2)
38-38
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
All instances of
TFDenom.String()
have been successfully replaced withPrettyString()
.
- No occurrences of
TFDenom{}.String()
were found in the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom\{\}\.String\(\)'Length of output: 40
71-71
: Ensure consistency in string representation methods.The changes from
String()
toPrettyString()
should be consistent across all usages ofTFDenom
. Verify that no instances ofString()
remain forTFDenom
.Verification successful
Ensure consistency in string representation methods.
- No instances of
TFDenom{}.String()
were found, indicating that all usages have been replaced withPrettyString()
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom{}.String()'Length of output: 144
Script:
#!/bin/bash # Description: Verify all instances of `TFDenom.String()` are replaced with `PrettyString()`. # Test: Search for the function usage. Expect: No occurrences of `TFDenom.String()`. rg --type go 'TFDenom\{\}\.String\(\)'Length of output: 40
x/tokenfactory/cli/cli_test.go (1)
84-86
: ReplaceString()
withPrettyString()
forTFDenom
instances.The changes correctly replace
String()
withPrettyString()
for better readability ofTFDenom
instances.x/tokenfactory/keeper/store.go (3)
37-37
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.
58-58
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.
87-87
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.x/tokenfactory/keeper/msg_server.go (1)
39-39
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.x/tokenfactory/keeper/wasm_test.go (4)
164-164
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.
176-176
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.
180-180
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.
192-192
: ReplaceString()
withPrettyString()
forTFDenom
instances.The change correctly replaces
String()
withPrettyString()
for better readability ofTFDenom
instances.x/tokenfactory/keeper/msg_server_test.go (4)
102-102
: ReplaceString()
withPrettyString()
in the expected result.The change from
String()
toPrettyString()
in the expected result aligns with the new method usage and improves readability.
140-140
: ReplaceString()
withPrettyString()
in the denomination creation and expected results.The changes from
String()
toPrettyString()
in the denomination creation and expected results align with the new method usage and improve readability.Also applies to: 159-159, 178-178
333-333
: ReplaceString()
withPrettyString()
in the denomination creation and expected results.The changes from
String()
toPrettyString()
in the denomination creation and expected results align with the new method usage and improve readability.Also applies to: 352-352, 366-366, 386-386, 391-391
536-536
: ReplaceString()
withPrettyString()
in the metadata setting.The changes from
String()
toPrettyString()
in the metadata setting align with the new method usage and improve readability.Also applies to: 542-542
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.
CHANGELOG.md
Outdated
@@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
- [#1820](https://github.com/NibiruChain/nibiru/pull/1820) - feat(ica): add interchain accounts | |||
- [#1864](https://github.com/NibiruChain/nibiru/pull/1864) - fix(ica): add ICA controller stack | |||
- [#1872](https://github.com/NibiruChain/nibiru/pull/1872) - chore(math): use cosmossdk.io/math to replace sdk types | |||
- [#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer |
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.
Ensure consistency in changelog entry format.
The entry for PR #1874 should follow the same format as other entries. Consider adding a description for clarity.
- [#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer
+ [#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer as per Cosmos SDK migration guidelines
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
- [#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer | |
[#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer as per Cosmos SDK migration guidelines |
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.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- x/tokenfactory/cli/cli_test.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/tokenfactory/cli/cli_test.go
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.
Actionable comments posted: 0
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1874 +/- ##
==========================================
+ Coverage 67.12% 67.17% +0.05%
==========================================
Files 212 212
Lines 13463 13447 -16
==========================================
- Hits 9037 9033 -4
+ Misses 3780 3768 -12
Partials 646 646
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- x/tokenfactory/cli/cli_test.go (4 hunks)
- x/tokenfactory/keeper/genesis.go (1 hunks)
- x/tokenfactory/keeper/genesis_test.go (1 hunks)
- x/tokenfactory/keeper/grpc_query_test.go (2 hunks)
- x/tokenfactory/keeper/msg_server.go (1 hunks)
- x/tokenfactory/keeper/msg_server_test.go (10 hunks)
- x/tokenfactory/keeper/store.go (3 hunks)
- x/tokenfactory/keeper/store_test.go (1 hunks)
- x/tokenfactory/keeper/wasm_test.go (4 hunks)
- x/tokenfactory/types/state.go (2 hunks)
- x/tokenfactory/types/state_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (11)
- x/tokenfactory/cli/cli_test.go
- x/tokenfactory/keeper/genesis.go
- x/tokenfactory/keeper/genesis_test.go
- x/tokenfactory/keeper/grpc_query_test.go
- x/tokenfactory/keeper/msg_server.go
- x/tokenfactory/keeper/msg_server_test.go
- x/tokenfactory/keeper/store.go
- x/tokenfactory/keeper/store_test.go
- x/tokenfactory/keeper/wasm_test.go
- x/tokenfactory/types/state.go
- x/tokenfactory/types/state_test.go
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.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
CHANGELOG.md (1)
Line range hint
63-63
: Remove trailing space.- +
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- x/tokenfactory/keeper/msg_server.go (1 hunks)
- x/tokenfactory/keeper/wasm_test.go (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- x/tokenfactory/keeper/msg_server.go
- x/tokenfactory/keeper/wasm_test.go
Additional comments not posted (1)
CHANGELOG.md (1)
53-54
: Changelog entry for PR #1874 looks good.
… into mat/stringer-protobuf commit.
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- x/tokenfactory/keeper/msg_server_test.go (10 hunks)
- x/tokenfactory/types/state.go (1 hunks)
- x/tokenfactory/types/state_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- x/tokenfactory/keeper/msg_server_test.go
- x/tokenfactory/types/state.go
- x/tokenfactory/types/state_test.go
As per https://docs.cosmos.network/v0.50/build/migrations/upgrading#stringer, remove the stringer from the gogo proto.
For TD denoms, I had to create a pretty print for the "tf/contract_address/denom" logic.