-
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
refactor!(staking): remove comet crypto as a dep #20295
Changes from all commits
1b0e4a6
b6d23d9
7784a8d
ba88f50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,13 @@ import ( | |
"strings" | ||
"time" | ||
|
||
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1" | ||
|
||
"cosmossdk.io/core/address" | ||
"cosmossdk.io/core/appmodule" | ||
"cosmossdk.io/errors" | ||
"cosmossdk.io/math" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
|
@@ -477,27 +474,6 @@ func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { | |
return pk, nil | ||
} | ||
|
||
// CmtConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey. | ||
func (v Validator) CmtConsPublicKey() (cmtprotocrypto.PublicKey, error) { | ||
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 the methods be deprecated instead to avoid breaking changes? 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. probably, its always nicer to remove things so its easy for us |
||
pk, err := v.ConsPubKey() | ||
if err != nil { | ||
return cmtprotocrypto.PublicKey{}, err | ||
} | ||
|
||
tmPk, err := cryptocodec.ToCmtProtoPublicKey(pk) | ||
if err != nil { | ||
return cmtprotocrypto.PublicKey{}, err | ||
} | ||
|
||
return tmPk, nil | ||
} | ||
|
||
// Deprecated: use CmtConsPublicKey instead | ||
// We do not delete this function as it is part of the ValidatorI interface | ||
func (v Validator) TmConsPublicKey() (cmtprotocrypto.PublicKey, error) { | ||
return v.CmtConsPublicKey() | ||
} | ||
|
||
// GetConsAddr extracts Consensus key address | ||
func (v Validator) GetConsAddr() ([]byte, error) { | ||
pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) | ||
|
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 the naming of cryptographic types.
Ensure that the type names
cryptotypes.PubKey
andcometcrypto.PublicKey
are consistently capitalized as they appear in the code. This helps maintain clarity and accuracy in documentation.Committable suggestion