-
Notifications
You must be signed in to change notification settings - Fork 181
/
migrate.go
27 lines (23 loc) · 948 Bytes
/
migrate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package v0_38
// DONTCOVER
// nolint
import (
v036distr "github.com/okex/exchain/libs/cosmos-sdk/x/distribution/legacy/v0_36"
)
// Migrate accepts exported genesis state from v0.36 or v0.37 and migrates it to
// v0.38 genesis state. All entries are identical except for parameters.
func Migrate(oldGenState v036distr.GenesisState) GenesisState {
params := Params{
CommunityTax: oldGenState.CommunityTax,
BaseProposerReward: oldGenState.BaseProposerReward,
BonusProposerReward: oldGenState.BonusProposerReward,
WithdrawAddrEnabled: oldGenState.WithdrawAddrEnabled,
}
return NewGenesisState(
params, oldGenState.FeePool,
oldGenState.DelegatorWithdrawInfos, oldGenState.PreviousProposer,
oldGenState.OutstandingRewards, oldGenState.ValidatorAccumulatedCommissions,
oldGenState.ValidatorHistoricalRewards, oldGenState.ValidatorCurrentRewards,
oldGenState.DelegatorStartingInfos, oldGenState.ValidatorSlashEvents,
)
}