-
Notifications
You must be signed in to change notification settings - Fork 26
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: fix CompactTextString
panics with nested Anys and private fields
#24
Conversation
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.
Let's check if we need to handle bool
type as well.
CompactTextString
panics with nested Anys and private fields
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.
utACK
>` | ||
got := proto.MarshalTextString(m) | ||
if strings.EqualFold(expected, got) { | ||
t.Errorf("got = %s, want %s", expected, got) |
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.
Invalid order of the error log; got should be first then expected :-) Also this test is saying that the values match with the same case then error out, did you mean if !strings.EqualFold?
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.
You are right, actually the test is not so useful either tbh (and wrong as you've noticed).
I have tested the fix using replace in the SDK directly, and quickly wrong this without paying too much attention :/ I can fix it or just remove it 🤷🏾♂️
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.
Please fix it :-) I am up and will gladly review it.
Closes cosmos/cosmos-sdk#10965.
Looking at the tests now. Using a
replace
in the Cosmos SDK resolves cosmos/cosmos-sdk#10965 and cosmos/cosmos-sdk#13838 (using the codegen String method)We'll need to tag
1.4.3
after.