fix(x/slashing): ValidatorSignInfo migration to collections was missing length prefix (#17127)
This commit is contained in:
@@ -45,7 +45,7 @@ func NewKeeper(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, storeServi
|
||||
sb,
|
||||
types.ValidatorSigningInfoKeyPrefix,
|
||||
"validator_signing_info",
|
||||
sdk.ConsAddressKey,
|
||||
sdk.LengthPrefixedAddressKey(sdk.ConsAddressKey), // nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility
|
||||
codec.CollValue[types.ValidatorSigningInfo](cdc),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package types
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
@@ -21,9 +20,3 @@ func NewValidatorSigningInfo(
|
||||
MissedBlocksCounter: missedBlocksCounter,
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalValSigningInfo unmarshals a validator signing info from a store value
|
||||
func UnmarshalValSigningInfo(cdc codec.Codec, value []byte) (signingInfo ValidatorSigningInfo, err error) {
|
||||
err = cdc.Unmarshal(value, &signingInfo)
|
||||
return signingInfo, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user