Skip to content

Commit

Permalink
remove extra methods & add section for the removal
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed May 7, 2024
1 parent 7784a8d commit ba88f50
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions x/staking/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#17335](https://github.com/cosmos/cosmos-sdk/pull/17335) Remove usage of `"cosmossdk.io/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking
* [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `QueryHistoricalInfo` was adjusted to return `HistoricalRecord` and marked `Hist` as deprecated.
* [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.Pubkey` instead of `cometcrypto.Publickey`. The caller is responsible to translate the returned value to the expected type.
* Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct.

### State Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion x/staking/keeper/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ func (k Keeper) GetPubKeyByConsAddr(ctx context.Context, addr sdk.ConsAddress) (
return nil, err
}

pubkey, err := v.CmtConsPublicKey()
pubkey, err := v.ConsPubKey()
if err != nil {
return nil, err
}
Expand Down
10 changes: 0 additions & 10 deletions x/staking/types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,6 @@ func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) {
return pk, nil
}

// CmtConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey.
func (v Validator) CmtConsPublicKey() (cryptotypes.PubKey, error) {
pk, err := v.ConsPubKey()
if err != nil {
return nil, err
}

return pk, nil
}

// GetConsAddr extracts Consensus key address
func (v Validator) GetConsAddr() ([]byte, error) {
pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey)
Expand Down

0 comments on commit ba88f50

Please sign in to comment.