mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-28 01:05:19 +00:00
28 lines
848 B
Go
28 lines
848 B
Go
|
package v038
|
||
|
|
||
|
import (
|
||
|
v038slashing "github.com/cosmos/cosmos-sdk/x/slashing"
|
||
|
|
||
|
"github.com/kava-labs/kava/migrate/v0_8/sdk/slashing/v18de63"
|
||
|
)
|
||
|
|
||
|
func Migrate(oldGenState v18de63.GenesisState) v038slashing.GenesisState {
|
||
|
|
||
|
// old and new types are identical except for the MaxEvidenceAge param
|
||
|
|
||
|
newParams := v038slashing.Params{
|
||
|
// no MaxEvidenceAge
|
||
|
SignedBlocksWindow: oldGenState.Params.SignedBlocksWindow,
|
||
|
MinSignedPerWindow: oldGenState.Params.MinSignedPerWindow,
|
||
|
DowntimeJailDuration: oldGenState.Params.DowntimeJailDuration,
|
||
|
SlashFractionDoubleSign: oldGenState.Params.SlashFractionDoubleSign,
|
||
|
SlashFractionDowntime: oldGenState.Params.SlashFractionDowntime,
|
||
|
}
|
||
|
|
||
|
return v038slashing.GenesisState{
|
||
|
Params: newParams,
|
||
|
SigningInfos: oldGenState.SigningInfos,
|
||
|
MissedBlocks: oldGenState.MissedBlocks,
|
||
|
}
|
||
|
}
|