-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore(all)!: use gogoproto/any instead of codec/types/any #21013
Changes from 5 commits
9fe74ba
59d8c51
94a3c7a
ea1a51f
5481b81
62e8963
eec42ba
6c3261a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,12 @@ import ( | |
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | ||
multisigtypes "github.com/cosmos/cosmos-sdk/crypto/types/multisig" | ||
"github.com/cosmos/cosmos-sdk/types/tx/signing" | ||
gogoprotoany "github.com/cosmos/gogoproto/types/any" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix import order. The import statement for -import (
"fmt"
cmtcrypto "github.com/cometbft/cometbft/crypto"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
multisigtypes "github.com/cosmos/cosmos-sdk/crypto/types/multisig"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
gogoprotoany "github.com/cosmos/gogoproto/types/any"
)
+import (
"fmt"
cmtcrypto "github.com/cometbft/cometbft/crypto"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
multisigtypes "github.com/cosmos/cosmos-sdk/crypto/types/multisig"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
gogoprotoany "github.com/cosmos/gogoproto/types/any"
)
Toolsgolangci-lint
|
||
) | ||
|
||
var ( | ||
_ multisigtypes.PubKey = &LegacyAminoPubKey{} | ||
_ types.UnpackInterfacesMessage = &LegacyAminoPubKey{} | ||
_ multisigtypes.PubKey = &LegacyAminoPubKey{} | ||
_ gogoprotoany.UnpackInterfacesMessage = &LegacyAminoPubKey{} | ||
) | ||
|
||
// NewLegacyAminoPubKey returns a new LegacyAminoPubKey. | ||
|
@@ -149,7 +150,7 @@ func (m *LegacyAminoPubKey) Type() string { | |
} | ||
|
||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces | ||
func (m *LegacyAminoPubKey) UnpackInterfaces(unpacker types.AnyUnpacker) error { | ||
func (m *LegacyAminoPubKey) UnpackInterfaces(unpacker gogoprotoany.AnyUnpacker) error { | ||
for _, any := range m.PubKeys { | ||
var pk cryptotypes.PubKey | ||
err := unpacker.UnpackAny(any, &pk) | ||
|
@@ -169,11 +170,6 @@ func packPubKeys(pubKeys []cryptotypes.PubKey) ([]*types.Any, error) { | |
return nil, err | ||
} | ||
anyPubKeys[i] = any | ||
|
||
// sets the compat.aminoBz value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be backported to v50? If so let's extract it in another PR |
||
if err := anyPubKeys[i].UnmarshalAmino(pubKeys[i].Bytes()); err != nil { | ||
return nil, err | ||
} | ||
} | ||
return anyPubKeys, nil | ||
} |
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.
Fix import order.
The import statement for
gogoprotoany
should follow the import order conventions.Tools
golangci-lint