From adf5485b48bfd7d0796c82be4082deee079d2b43 Mon Sep 17 00:00:00 2001 From: huangyi Date: Tue, 27 Apr 2021 22:14:17 +0800 Subject: [PATCH] fix validator address prefix --- x/staking/keeper/val_state_change.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 4eece491d429..c1d6c3f3d1b5 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -165,7 +165,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab } // fetch the old power bytes - valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixValAddr, valAddr) + valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.GetConfig().GetBech32ValidatorAddrPrefix(), valAddr) if err != nil { return nil, err } @@ -363,7 +363,7 @@ func (k Keeper) getLastValidatorsByAddr(ctx sdk.Context) (validatorsByAddr, erro for ; iterator.Valid(); iterator.Next() { // extract the validator address from the key (prefix is 1-byte, addrLen is 1-byte) valAddr := types.AddressFromLastValidatorPowerKey(iterator.Key()) - valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixValAddr, valAddr) + valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.GetConfig().GetBech32ValidatorAddrPrefix(), valAddr) if err != nil { return nil, err }