diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 394d3ad6b2..9feb88cde6 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const releaseVersion = "0.13.0-rc3" +const releaseVersion = "0.13.0" func SetupHandlers(app *SifchainApp) { app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm m.VersionMap) (m.VersionMap, error) { diff --git a/version b/version index 9525041243..54d1a4f2a4 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.13.0-rc3 +0.13.0 diff --git a/x/clp/keeper/migrations.go b/x/clp/keeper/migrations.go index f3a09a7bd3..7d57219cd9 100644 --- a/x/clp/keeper/migrations.go +++ b/x/clp/keeper/migrations.go @@ -43,65 +43,3 @@ func (m Migrator) MigrateToVer2(ctx sdk.Context) error { } return nil } - -func (m Migrator) MigrateToVer3(ctx sdk.Context) error { - // Initiate Rewards - m.keeper.SetRewardParams(ctx, types.GetDefaultRewardParams()) - // Initiate PMTP - m.keeper.SetPmtpRateParams(ctx, types.PmtpRateParams{ - PmtpPeriodBlockRate: sdk.ZeroDec(), - PmtpCurrentRunningRate: sdk.ZeroDec(), - PmtpInterPolicyRate: sdk.ZeroDec(), - }) - m.keeper.SetPmtpEpoch(ctx, types.PmtpEpoch{ - EpochCounter: 0, - BlockCounter: 0, - }) - m.keeper.SetPmtpParams(ctx, types.GetDefaultPmtpParams()) - m.keeper.SetPmtpInterPolicyRate(ctx, sdk.NewDec(0)) - pools := m.keeper.GetPools(ctx) - for _, pool := range pools { - spe := sdk.ZeroDec() - spn := sdk.ZeroDec() - rpnd := sdk.ZeroUint() - pool.SwapPriceExternal = &spe - pool.SwapPriceNative = &spn - pool.RewardPeriodNativeDistributed = rpnd - err := m.keeper.SetPool(ctx, pool) - if err != nil { - panic(err) - } - } - return nil -} - -func (m Migrator) MigrateToVer4(ctx sdk.Context) error { - // Initiate Rewards - m.keeper.SetRewardParams(ctx, types.GetDefaultRewardParams()) - // Initiate PMTP - m.keeper.SetPmtpRateParams(ctx, types.PmtpRateParams{ - PmtpPeriodBlockRate: sdk.ZeroDec(), - PmtpCurrentRunningRate: sdk.ZeroDec(), - PmtpInterPolicyRate: sdk.ZeroDec(), - }) - m.keeper.SetPmtpEpoch(ctx, types.PmtpEpoch{ - EpochCounter: 0, - BlockCounter: 0, - }) - m.keeper.SetPmtpParams(ctx, types.GetDefaultPmtpParams()) - m.keeper.SetPmtpInterPolicyRate(ctx, sdk.NewDec(0)) - pools := m.keeper.GetPools(ctx) - for _, pool := range pools { - spe := sdk.ZeroDec() - spn := sdk.ZeroDec() - rpnd := sdk.ZeroUint() - pool.SwapPriceExternal = &spe - pool.SwapPriceNative = &spn - pool.RewardPeriodNativeDistributed = rpnd - err := m.keeper.SetPool(ctx, pool) - if err != nil { - panic(err) - } - } - return nil -} diff --git a/x/clp/module.go b/x/clp/module.go index 1d0c43eb60..cf190be17f 100644 --- a/x/clp/module.go +++ b/x/clp/module.go @@ -136,14 +136,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err != nil { panic(err) } - err = cfg.RegisterMigration(types.ModuleName, 2, m.MigrateToVer3) - if err != nil { - panic(err) - } - err = cfg.RegisterMigration(types.ModuleName, 3, m.MigrateToVer4) - if err != nil { - panic(err) - } } // InitGenesis performs genesis initialization for the clp module. It returns @@ -173,4 +165,4 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val return EndBlocker(ctx, am.keeper) } -func (AppModule) ConsensusVersion() uint64 { return 4 } +func (AppModule) ConsensusVersion() uint64 { return 2 } diff --git a/x/clp/types/keys.go b/x/clp/types/keys.go index fad6936c04..6eb68d8528 100644 --- a/x/clp/types/keys.go +++ b/x/clp/types/keys.go @@ -52,25 +52,6 @@ func GetLiquidityProviderKey(externalTicker string, lp string) []byte { return append(LiquidityProviderPrefix, key...) } -// TODO remove -// func DefaultRewardsPeriod() []*RewardPeriod { -// rp_1_allocation := sdk.NewUintFromString("10000000000000000000000") -// cethMultiplier := sdk.MustNewDecFromStr("1.5") -// rewardPeriods := []*RewardPeriod{ -// { -// RewardPeriodId: "RP_1", -// RewardPeriodStartBlock: 1, -// RewardPeriodEndBlock: 12 * 60 * 24 * 7, -// RewardPeriodAllocation: &rp_1_allocation, -// RewardPeriodPoolMultipliers: []*PoolMultiplier{{ -// PoolMultiplierAsset: "ceth", -// Multiplier: &cethMultiplier, -// }}, -// }, -// } -// return rewardPeriods -// } - func GetDefaultRewardParams() *RewardParams { return &RewardParams{ LiquidityRemovalLockPeriod: 12 * 60 * 24 * 7, diff --git a/x/tokenregistry/keeper/migrations.go b/x/tokenregistry/keeper/migrations.go index 7c906e339d..1a85231186 100644 --- a/x/tokenregistry/keeper/migrations.go +++ b/x/tokenregistry/keeper/migrations.go @@ -26,14 +26,8 @@ func (m Migrator) MigrateToVer2(ctx sdk.Context) error { } func (m Migrator) MigrateToVer3(ctx sdk.Context) error { - accounts := tkrtypes.AdminAccounts{} - if ctx.ChainID() == "sifchain-1" { - gen := tkrtypes.ProdAdminAccounts() - accounts = *gen - } else { - gen := tkrtypes.InitialAdminAccounts() - accounts = *gen - } + gen := tkrtypes.ProdAdminAccounts() + accounts := *gen m.keeper.DeleteOldAdminAccount(ctx) for _, account := range accounts.AdminAccounts { m.keeper.SetAdminAccount(ctx, account) diff --git a/x/tokenregistry/types/genesis.go b/x/tokenregistry/types/genesis.go index e9e147e045..304417981f 100644 --- a/x/tokenregistry/types/genesis.go +++ b/x/tokenregistry/types/genesis.go @@ -56,6 +56,14 @@ func ProdAdminAccounts() *AdminAccounts { AdminType: AdminType_ETHBRIDGE, AdminAddress: "sif144w8cpva2xkly74xrms8djg69y3mljzplx3fjt", }, + { + AdminType: AdminType_TOKENREGISTRY, + AdminAddress: "sif1tpypxpppcf5lea47vcvgy09675nllmcucxydvu", + }, + { + AdminType: AdminType_ETHBRIDGE, + AdminAddress: "sif1tpypxpppcf5lea47vcvgy09675nllmcucxydvu", + }, }, } }