diff --git a/pkg/types/tendermint.go b/pkg/types/tendermint.go index 7413219..936b08d 100644 --- a/pkg/types/tendermint.go +++ b/pkg/types/tendermint.go @@ -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 { @@ -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"`