fix(x/slashing): ValidatorSignInfo migration to collections was missing length prefix (#17127)

This commit is contained in:
Facundo Medica
2023-07-25 15:50:38 +00:00
committed by GitHub
parent b0acf60e6c
commit 974abde0c4
2 changed files with 1 additions and 8 deletions
+1 -1
View File
@@ -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),
),
}
-7
View File
@@ -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
}