Skip to content
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

Remove bech32 PubKey support #7477

Merged
merged 109 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
faa822a
Move PubKey bech32 to legacy package and migrate the usage where poss…
robert-zaremba Nov 3, 2020
2324c4e
update /server
robert-zaremba Nov 3, 2020
7df2182
wip
robert-zaremba Nov 3, 2020
9198817
move proto json encoding helper functions to internal
robert-zaremba Nov 5, 2020
412ccc4
update internal/marshal
robert-zaremba Nov 9, 2020
35275d7
wip
robert-zaremba Nov 9, 2020
dd6f93b
update sections which needs legacybech32
robert-zaremba Nov 16, 2020
17a6b1e
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Nov 16, 2020
7af7ab3
update validators output
robert-zaremba Nov 16, 2020
8331f33
fix conflicts
robert-zaremba Nov 16, 2020
41cbd9f
slashing update
robert-zaremba Nov 17, 2020
238e334
add more tests and helper function for ANY JSON serialization
robert-zaremba Nov 18, 2020
ee70afb
update slashing
robert-zaremba Nov 18, 2020
084c306
Update function documentation
robert-zaremba Nov 18, 2020
7974b42
Rename code any-marshal helper functions
robert-zaremba Nov 18, 2020
943a4ff
Update pubkey unpacking test
robert-zaremba Nov 18, 2020
3a0904b
Update test comments
robert-zaremba Nov 18, 2020
6d00c2e
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Nov 23, 2020
46f85ce
solve TestDecodeStore
robert-zaremba Nov 23, 2020
2b35020
solve legacytx issues
robert-zaremba Nov 23, 2020
f7411dd
all code compiles
robert-zaremba Nov 23, 2020
c906d74
keyring tests
robert-zaremba Nov 24, 2020
0632000
keyring cleanup
robert-zaremba Nov 24, 2020
7151b25
remove AssertMsg
robert-zaremba Nov 24, 2020
9a12242
fix some tests
robert-zaremba Nov 24, 2020
f4a585b
fix add_ledger_test.go
robert-zaremba Nov 24, 2020
b6e5582
update cli tests
robert-zaremba Nov 24, 2020
c5be087
debug cli test
robert-zaremba Nov 24, 2020
f6fd51e
rename clashed bech32 names
robert-zaremba Nov 24, 2020
21e3dc6
linter fixes
robert-zaremba Nov 24, 2020
55d4db2
merge master
robert-zaremba Nov 26, 2020
688e3ca
update tmservice tests
robert-zaremba Nov 27, 2020
14bfa7b
linter: update legacy deprecated checks
robert-zaremba Nov 27, 2020
218f54b
fix names
robert-zaremba Nov 27, 2020
829db7d
linting
robert-zaremba Nov 27, 2020
452e406
legacybech32 pubkey type rename
robert-zaremba Nov 27, 2020
81aab57
fix staking client
robert-zaremba Nov 27, 2020
ae91f0f
fix test compilation
robert-zaremba Nov 27, 2020
69572c6
fix TestGetCmdQuerySigningInfo
robert-zaremba Nov 28, 2020
288a080
rename NewIfcJSONAnyMarshaler
robert-zaremba Nov 28, 2020
773d0c6
keyring: remove duplicated information from multinfo structure
robert-zaremba Nov 30, 2020
8f86bf4
todo cleanups
robert-zaremba Nov 30, 2020
904129e
Update Changelog
robert-zaremba Nov 30, 2020
c6f003c
remove some legacybech32 from tests
robert-zaremba Nov 30, 2020
47eceb6
remove todos
robert-zaremba Nov 30, 2020
3a94d65
remove printlnJSON from /server CLI and amino encoding
robert-zaremba Nov 30, 2020
dc9f743
remove protocdc.MarshalJSON
robert-zaremba Nov 30, 2020
da24773
client/show remove duplicated function
robert-zaremba Nov 30, 2020
a965f3a
remove protocdc package
robert-zaremba Nov 30, 2020
2e95ae8
comment update
robert-zaremba Nov 30, 2020
937f11d
remove legacybech32.MustMarshalPubKey from a test
robert-zaremba Nov 30, 2020
18613c5
add todo
robert-zaremba Dec 1, 2020
20f44f2
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Dec 1, 2020
f60c9b7
fix TestPublicKeyUnsafe test
robert-zaremba Dec 1, 2020
50ecab7
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Dec 1, 2020
7401c1a
review update
robert-zaremba Dec 2, 2020
d3d83b8
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Jan 11, 2021
eb68268
fix bech32 UnmarshalPubKey
robert-zaremba Jan 11, 2021
4a28e7a
Use codec.MarshalIfcJSON
robert-zaremba Jan 11, 2021
801984b
fix linter issues
robert-zaremba Jan 11, 2021
a05c1b2
merging conflict: fix codec.Unmarshal calls
robert-zaremba Jan 11, 2021
7443c6c
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Jan 11, 2021
e6292e1
cleanups
robert-zaremba Jan 12, 2021
d55f19e
Update CHANGELOG.md
robert-zaremba Jan 12, 2021
4be2229
Reword changelog updates
robert-zaremba Jan 12, 2021
83fcfd0
use pubkey.String for comparison in Test_runAddCmdLedgerWithCustomCoi…
robert-zaremba Jan 12, 2021
84a0c21
Update GetCmdQuerySigningInfo example
robert-zaremba Jan 12, 2021
4e60fad
cli: update keys add docs
robert-zaremba Jan 13, 2021
8eba4b0
Add errors AsOf and errors.ErrIO type
robert-zaremba Jan 13, 2021
d0beb74
restore multisigPubKeyInfo structure bring it back to multiInfo struct
robert-zaremba Jan 13, 2021
09aca5c
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Jan 13, 2021
707f054
Update codec/proto_codec.go
robert-zaremba Jan 15, 2021
f5b060c
Update crypto/keys/ed25519/ed25519_test.go
robert-zaremba Jan 15, 2021
a0a0285
Update codec/proto_codec.go
robert-zaremba Jan 15, 2021
75fdcbd
move pubkey any marshaling tests
robert-zaremba Jan 15, 2021
7ebc098
Apply suggestions from code review
robert-zaremba Jan 15, 2021
142913f
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Jan 15, 2021
12b22b5
review updates
robert-zaremba Jan 15, 2021
6848e63
adding missing return
robert-zaremba Jan 15, 2021
d37b1c5
errors: use IsOf instead of AsOf
robert-zaremba Jan 16, 2021
f667fe4
keyring: add a correct check for key not found in keyring.Get
robert-zaremba Jan 16, 2021
1564845
add checkKeyNotFound
robert-zaremba Jan 18, 2021
190f0c0
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 9, 2021
a7cc794
fix linter issues
robert-zaremba Mar 9, 2021
705143e
fix: keyring key not found check
robert-zaremba Mar 9, 2021
e3ef9b8
fix keyring tests
robert-zaremba Mar 10, 2021
51f764d
fix linting issues
robert-zaremba Mar 10, 2021
17a47a2
cli tests
robert-zaremba Mar 10, 2021
ecdf1c3
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 10, 2021
61cba59
fix: 'simd keys show <key> -p'
robert-zaremba Mar 10, 2021
74e2b13
fix: TestVerifyMultisignature
robert-zaremba Mar 10, 2021
bccf755
rename keyring Bech32... functions to Mk...
robert-zaremba Mar 11, 2021
ba7042d
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 23, 2021
e58f6a8
fix RunAddCmd
robert-zaremba Mar 23, 2021
a9a0a55
Update pubkey display
robert-zaremba Mar 23, 2021
65485a5
wip
robert-zaremba Mar 23, 2021
eaea2f4
add more tests
robert-zaremba Mar 23, 2021
954f779
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 23, 2021
ba700c4
udate keyring output tests
robert-zaremba Mar 23, 2021
d6e76d7
remove todo from ledger tests
robert-zaremba Mar 23, 2021
192999e
rename MkKeyOutput
robert-zaremba Mar 24, 2021
d087500
Changelog update
robert-zaremba Mar 24, 2021
3ff91cc
solve liner issues
robert-zaremba Mar 24, 2021
d831489
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 24, 2021
b0b8f59
add link to github issue
robert-zaremba Mar 24, 2021
0436894
Merge branch 'master' into robert/rm-bech32-pk
aaronc Mar 24, 2021
75c36fc
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 25, 2021
1279ac6
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 25, 2021
152ad45
Merge branch 'master' into robert/rm-bech32-pk
robert-zaremba Mar 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- path: "legacy"
text: "SA1019:"
linters:
- staticcheck

max-issues-per-linter: 10000
max-same-issues: 10000

Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#8363](https://github.com/cosmos/cosmos-sdk/pull/8363) Addresses no longer have a fixed 20-byte length. From the SDK modules' point of view, any 1-255 bytes-long byte array is a valid address.
* [\#8346](https://github.com/cosmos/cosmos-sdk/pull/8346) All CLI `tx` commands generate ServiceMsgs by default. Graceful Amino support has been added to ServiceMsgs to support signing legacy Msgs.
* (crypto/ed25519) [\#8690] Adopt zip1215 ed2559 verification rules.
* [\#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades.
* [\#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades.
* [\#8880](https://github.com/cosmos/cosmos-sdk/pull/8880) The CLI `simd migrate v0.40 ...` command has been renamed to `simd migrate v0.42`.
* [\#7477](https://github.com/cosmos/cosmos-sdk/pull/7477) Changed Bech32 Public Key serialization in the client facing functionality (CLI, MsgServer, QueryServer):
* updated the keyring display structure (it uses protobuf JSON serialization) - the output is more verbose.
* Renamed `MarshalAny` and `UnmarshalAny` to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take an interface as parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization.
* CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON.


### API Breaking Changes
Expand All @@ -66,6 +70,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/upgrade) [\#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) `UpgradeHandler` includes a new argument `VersionMap` which helps facilitate in-place migrations.
* (x/auth) [\#8129](https://github.com/cosmos/cosmos-sdk/pull/8828) Updated `SigVerifiableTx.GetPubKeys` method signature to return error.
* [\#8682](https://github.com/cosmos/cosmos-sdk/pull/8682) `ante.NewAnteHandler` updated to receive all positional params as `ante.HandlerOptions` struct. If required fields aren't set, throws error accordingly.
* (x/staking/types) [\#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support:
* `ValidatorI` interface update: `GetConsPubKey` renamed to `TmConsPubKey` (this is to clarify the return type: consensus public key must be a tendermint key); `TmConsPubKey`, `GetConsAddr` methods return error.
* `Validator` updated according to the `ValidatorI` changes described above.
* `ToTmValidator` function: added `error` to return values.
* `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`.
* `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`.


### State Machine Breaking
Expand All @@ -79,7 +89,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (x/staking) [\#8909](https://github.com/cosmos/cosmos-sdk/pull/8909) Require self delegation in `MsgCreateValidator` to be at least one consensus power.
* (x/staking) [\#8909](https://github.com/cosmos/cosmos-sdk/pull/8909) Require self delegation in `MsgCreateValidator` to be at least one consensus power.
* (x/bank) [\#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata
* (x/auth) [\#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts
* (crypto/types) [\#8600](https://github.com/cosmos/cosmos-sdk/pull/8600) `CompactBitArray`: optimize the `NumTrueBitsBefore` method and add an `Equal` method.
Expand Down Expand Up @@ -183,6 +193,7 @@ he Cosmos Hub) should not use this release or any release in the v0.41.x series.
* (x/ibc) [\#8266](https://github.com/cosmos/cosmos-sdk/issues/8266) Add amino JSON support for IBC MsgTransfer in order to support Ledger text signing transfer transactions.
* (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks.


### Bug Fixes

* (simapp) [\#8418](https://github.com/cosmos/cosmos-sdk/pull/8418) Add balance coin to supply when adding a new genesis account
Expand Down
98 changes: 17 additions & 81 deletions client/debug/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package debug

import (
"encoding/base64"
"encoding/hex"
"fmt"
"strconv"
Expand All @@ -10,13 +9,12 @@ import (
"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/version"
)

// Cmd creates a main CLI command
func Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "debug",
Expand All @@ -31,90 +29,31 @@ func Cmd() *cobra.Command {
return cmd
}

// getPubKeyFromString returns a Tendermint PubKey (PubKeyEd25519) by attempting
// to decode the pubkey string from hex, base64, and finally bech32. If all
// encodings fail, an error is returned.
func getPubKeyFromString(pkstr string) (cryptotypes.PubKey, error) {
bz, err := hex.DecodeString(pkstr)
if err == nil {
if len(bz) == ed25519.PubKeySize {
return &ed25519.PubKey{Key: bz}, nil
}
}

bz, err = base64.StdEncoding.DecodeString(pkstr)
if err == nil {
if len(bz) == ed25519.PubKeySize {
return &ed25519.PubKey{Key: bz}, nil
}
}

pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeAccPub, pkstr)
if err == nil {
return pk, nil
}

pk, err = sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeValPub, pkstr)
if err == nil {
return pk, nil
}

pk, err = sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, pkstr)
if err == nil {
return pk, nil
}

return nil, fmt.Errorf("pubkey '%s' invalid; expected hex, base64, or bech32 of correct size", pkstr)
// getPubKeyFromString decodes SDK PubKey using JSON marshaler.
func getPubKeyFromString(ctx client.Context, pkstr string) (cryptotypes.PubKey, error) {
var pk cryptotypes.PubKey
err := ctx.JSONMarshaler.UnmarshalInterfaceJSON([]byte(pkstr), &pk)
return pk, err
}

func PubkeyCmd() *cobra.Command {
return &cobra.Command{
Use: "pubkey [pubkey]",
Short: "Decode a ED25519 pubkey from hex, base64, or bech32",
Long: fmt.Sprintf(`Decode a pubkey from hex, base64, or bech32.
Short: "Decode a pubkey from proto JSON",
Long: fmt.Sprintf(`Decode a pubkey from proto JSON and display it's address.

Example:
$ %s debug pubkey TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
$ %s debug pubkey cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
`, version.AppName, version.AppName),
$ %s debug pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ"}'
`, version.AppName),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)

pk, err := getPubKeyFromString(args[0])
if err != nil {
return err
}

edPK, ok := pk.(*ed25519.PubKey)
if !ok {
return errors.Wrapf(errors.ErrInvalidType, "invalid pubkey type; expected ED25519")
}

pubKeyJSONBytes, err := clientCtx.LegacyAmino.MarshalJSON(edPK)
if err != nil {
return err
}
accPub, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, edPK)
if err != nil {
return err
}
valPub, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeValPub, edPK)
pk, err := getPubKeyFromString(clientCtx, args[0])
if err != nil {
return err
}
consenusPub, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, edPK)
if err != nil {
return err
}

cmd.Println("Address:", edPK.Address())
cmd.Printf("Hex: %X\n", edPK.Key)
cmd.Println("JSON (base64):", string(pubKeyJSONBytes))
cmd.Println("Bech32 Acc:", accPub)
cmd.Println("Bech32 Validator Operator:", valPub)
cmd.Println("Bech32 Validator Consensus:", consenusPub)

cmd.Println("Address:", pk.Address())
cmd.Println("PubKey Hex:", hex.EncodeToString(pk.Bytes()))
return nil
},
}
Expand All @@ -125,7 +64,7 @@ func AddrCmd() *cobra.Command {
Use: "addr [address]",
Short: "Convert an address between hex and bech32",
Long: fmt.Sprintf(`Convert an address between hex encoding and bech32.

Example:
$ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
`, version.AppName),
Expand All @@ -152,13 +91,10 @@ $ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
}
}

accAddr := sdk.AccAddress(addr)
valAddr := sdk.ValAddress(addr)

cmd.Println("Address:", addr)
cmd.Printf("Address (hex): %X\n", addr)
cmd.Printf("Bech32 Acc: %s\n", accAddr)
cmd.Printf("Bech32 Val: %s\n", valAddr)
cmd.Printf("Bech32 Acc: %s\n", sdk.AccAddress(addr))
cmd.Printf("Bech32 Val: %s\n", sdk.ValAddress(addr))
return nil
},
}
Expand All @@ -169,7 +105,7 @@ func RawBytesCmd() *cobra.Command {
Use: "raw-bytes [raw-bytes]",
Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex",
Long: fmt.Sprintf(`Convert raw-bytes to hex.

Example:
$ %s debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]
`, version.AppName),
Expand Down
68 changes: 26 additions & 42 deletions client/grpc/tmservice/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,33 +95,7 @@ func (s queryServer) GetLatestValidatorSet(ctx context.Context, req *GetLatestVa
if err != nil {
return nil, err
}

validatorsRes, err := rpc.GetValidators(ctx, s.clientCtx, nil, &page, &limit)
if err != nil {
return nil, err
}

outputValidatorsRes := &GetLatestValidatorSetResponse{
BlockHeight: validatorsRes.BlockHeight,
Validators: make([]*Validator, len(validatorsRes.Validators)),
Pagination: &qtypes.PageResponse{
Total: validatorsRes.Total,
},
}

for i, validator := range validatorsRes.Validators {
anyPub, err := codectypes.NewAnyWithValue(validator.PubKey)
if err != nil {
return nil, err
}
outputValidatorsRes.Validators[i] = &Validator{
Address: validator.Address.String(),
ProposerPriority: validator.ProposerPriority,
PubKey: anyPub,
VotingPower: validator.VotingPower,
}
}
return outputValidatorsRes, nil
return validatorsOutput(ctx, s.clientCtx, nil, page, limit)
}

func (m *GetLatestValidatorSetResponse) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
Expand Down Expand Up @@ -149,32 +123,42 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida
if req.Height > chainHeight {
return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length")
}

validatorsRes, err := rpc.GetValidators(ctx, s.clientCtx, &req.Height, &page, &limit)

r, err := validatorsOutput(ctx, s.clientCtx, &req.Height, page, limit)
if err != nil {
return nil, err
}
return &GetValidatorSetByHeightResponse{
BlockHeight: r.BlockHeight,
Validators: r.Validators,
Pagination: r.Pagination,
}, nil
}

outputValidatorsRes := &GetValidatorSetByHeightResponse{
BlockHeight: validatorsRes.BlockHeight,
Validators: make([]*Validator, len(validatorsRes.Validators)),
Pagination: &qtypes.PageResponse{Total: validatorsRes.Total},
func validatorsOutput(ctx context.Context, cctx client.Context, height *int64, page, limit int) (*GetLatestValidatorSetResponse, error) {
vs, err := rpc.GetValidators(ctx, cctx, height, &page, &limit)
if err != nil {
return nil, err
}

for i, validator := range validatorsRes.Validators {
anyPub, err := codectypes.NewAnyWithValue(validator.PubKey)
resp := GetLatestValidatorSetResponse{
BlockHeight: vs.BlockHeight,
Validators: make([]*Validator, len(vs.Validators)),
Pagination: &qtypes.PageResponse{
Total: vs.Total,
},
}
for i, v := range vs.Validators {
anyPub, err := codectypes.NewAnyWithValue(v.PubKey)
if err != nil {
return nil, err
}
outputValidatorsRes.Validators[i] = &Validator{
Address: validator.Address.String(),
ProposerPriority: validator.ProposerPriority,
resp.Validators[i] = &Validator{
Address: v.Address.String(),
ProposerPriority: v.ProposerPriority,
PubKey: anyPub,
VotingPower: validator.VotingPower,
VotingPower: v.VotingPower,
}
}
return outputValidatorsRes, nil
return &resp, nil
}

// GetNodeInfo implements ServiceServer.GetNodeInfo
Expand Down
Loading