fix: return named error for write validators (#14919)
This commit is contained in:
parent
e03195e4b8
commit
23d9fc45f7
@ -290,6 +290,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf
|
||||
* (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints.
|
||||
* (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Handle missing account numbers during `InitGenesis`.
|
||||
* (cli) [#14509](https://github.com/cosmos/cosmos-sdk/pull/#14509) Added missing options to keyring-backend flag usage
|
||||
* (cli) [#14919](https://github.com/cosmos/cosmos-sdk/pull/#14919) Fix never assigned error when write validators.
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
||||
@ -12,14 +12,16 @@ import (
|
||||
)
|
||||
|
||||
// WriteValidators returns a slice of bonded genesis validators.
|
||||
func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []tmtypes.GenesisValidator, err error) {
|
||||
func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []tmtypes.GenesisValidator, returnErr error) {
|
||||
keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) {
|
||||
pk, err := validator.ConsPubKey()
|
||||
if err != nil {
|
||||
returnErr = err
|
||||
return true
|
||||
}
|
||||
tmPk, err := cryptocodec.ToTmPubKeyInterface(pk)
|
||||
if err != nil {
|
||||
returnErr = err
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user