Skip to content

Commit

Permalink
chore: removed unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed May 18, 2024
1 parent 418eb8d commit 4a3d9a9
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions pkg/types/tendermint.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package types

import (
b64 "encoding/base64"
"main/pkg/constants"
"main/pkg/utils"
"time"

codecTypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptoTypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types"
)

type ValidatorResponse struct {
Expand Down Expand Up @@ -53,30 +47,6 @@ type ConsensusPubkey struct {
Key string `json:"key"`
}

func (key *ConsensusPubkey) GetValConsAddress(prefix string) (string, error) {
encCfg := simapp.MakeTestEncodingConfig()
interfaceRegistry := encCfg.InterfaceRegistry

sDec, _ := b64.StdEncoding.DecodeString(key.Key)
pk := codecTypes.Any{
TypeUrl: key.Type,
Value: append([]byte{10, 32}, sDec...),
}

var pkProto cryptoTypes.PubKey
if err := interfaceRegistry.UnpackAny(&pk, &pkProto); err != nil {
return "", err
}

cosmosValCons := types.ConsAddress(pkProto.Address()).String()
properValCons, err := utils.ChangeBech32Prefix(cosmosValCons, prefix)
if err != nil {
return "", err
}

return properValCons, nil
}

type PaginationResponse struct {
Code int `json:"code"`
Pagination Pagination `json:"pagination"`
Expand Down

0 comments on commit 4a3d9a9

Please sign in to comment.