From 4a3d9a932bea77cf5262dbfb61fcbf5ee28dbf81 Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 3 May 2024 06:28:11 +0300 Subject: [PATCH] chore: removed unused function --- pkg/types/tendermint.go | 30 ------------------------------ 1 file changed, 30 deletions(-) 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"`