-
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
lint sdk main 48 #15528
lint sdk main 48 #15528
Conversation
return bz | ||
} | ||
|
||
func (cdc *LegacyAmino) marshalAnys(o interface{}) error { | ||
func (cdc *LegacyAmino) marshalAnys(o any) error { | ||
return types.UnpackInterfaces(o, types.AminoPacker{Cdc: cdc.Amino}) | ||
} | ||
|
||
func (cdc *LegacyAmino) unmarshalAnys(o interface{}) error { | ||
func (cdc *LegacyAmino) unmarshalAnys(o any) error { | ||
return types.UnpackInterfaces(o, types.AminoUnpacker{Cdc: cdc.Amino}) | ||
} | ||
|
||
func (cdc *LegacyAmino) jsonMarshalAnys(o interface{}) error { | ||
func (cdc *LegacyAmino) jsonMarshalAnys(o any) error { | ||
return types.UnpackInterfaces(o, types.AminoJSONPacker{Cdc: cdc.Amino}) | ||
} | ||
|
||
func (cdc *LegacyAmino) jsonUnmarshalAnys(o interface{}) error { | ||
func (cdc *LegacyAmino) jsonUnmarshalAnys(o any) error { | ||
return types.UnpackInterfaces(o, types.AminoJSONUnpacker{Cdc: cdc.Amino}) | ||
} | ||
|
||
func (cdc *LegacyAmino) Marshal(o interface{}) ([]byte, error) { | ||
func (cdc *LegacyAmino) Marshal(o any) ([]byte, error) { | ||
err := cdc.marshalAnys(o) | ||
if err != nil { | ||
return nil, err | ||
} |
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.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/codec.LegacyAmino).jsonMarshalAnys (codec/amino.go:71)
(*github.com/cosmos/cosmos-sdk/codec.LegacyAmino).MarshalJSON (codec/amino.go:142)
(github.com/cosmos/cosmos-sdk/types.ABCIMessageLogs).String (codec/amino.go:50)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runMsgs (codec/amino.go:773)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runTx (codec/amino.go:614)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).DeliverTx (codec/amino.go:410)
} | ||
|
||
// MarshalJSON implements codec.Codec interface | ||
func (cdc *LegacyAmino) MarshalJSON(o interface{}) ([]byte, error) { | ||
func (cdc *LegacyAmino) MarshalJSON(o any) ([]byte, error) { | ||
err := cdc.jsonMarshalAnys(o) | ||
if err != nil { | ||
return nil, err | ||
} |
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.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/codec.LegacyAmino).MarshalJSON (codec/amino.go:142)
(github.com/cosmos/cosmos-sdk/types.ABCIMessageLogs).String (codec/amino.go:50)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runMsgs (codec/amino.go:773)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runTx (codec/amino.go:614)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).DeliverTx (codec/amino.go:410)
OpWeightExec = "op_weight_msg_execute" //nolint:gosec | ||
OpWeightMsgGrant = "op_weight_msg_grant" | ||
OpWeightRevoke = "op_weight_msg_revoke" | ||
OpWeightExec = "op_weight_msg_execute" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
OpWeightRevoke = "op_weight_msg_revoke" //nolint:gosec | ||
OpWeightExec = "op_weight_msg_execute" //nolint:gosec | ||
OpWeightMsgGrant = "op_weight_msg_grant" | ||
OpWeightRevoke = "op_weight_msg_revoke" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
OpWeightMsgGrant = "op_weight_msg_grant" //nolint:gosec | ||
OpWeightRevoke = "op_weight_msg_revoke" //nolint:gosec | ||
OpWeightExec = "op_weight_msg_execute" //nolint:gosec | ||
OpWeightMsgGrant = "op_weight_msg_grant" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
@@ -14,7 +14,7 @@ | |||
const ( | |||
DefaultWeightMsgUpdateParams int = 100 | |||
|
|||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" //nolint:gosec | |||
OpWeightMsgUpdateParams = "op_weight_msg_update_params" |
Check failure
Code scanning / gosec
Potential hardcoded credentials
Hey! Before you are doing the whole codebase, my two cents is that types, constant, structs, etc... should not always be grouped. It is best to keep them close to their methods, or usage; otherwise it is harder to read. Baseapp here is the best example, I find after your changes it is way harder to read than before. Thoughts @kocubinski @alexanderbez @tac0turtle @mark-rushakoff ? |
My laptop cannot handle the GitHub diff 😅 but your changes in the |
Please open smaller prs. Reviewing such large prs consumes too much time |
hmmmmm -- kinda do want this. I feel the codebase is a bit disorganized. The go.mod stuff is just for using go.work while making the PR. It is legit too large, but that's why I'm doing it between releases. |
Description
Updated linting to match updated go and updated linters. WIP.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change