Skip to content

Commit

Permalink
updating upgrade handlers (testnet)
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikasr committed Feb 20, 2024
1 parent 39c98d9 commit dbaa0bb
Showing 4 changed files with 14 additions and 53 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
@@ -1598,7 +1598,7 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {
func (a *App) registerUpgradeHandlers() {
a.UpgradeKeeper.SetUpgradeHandler(
tv14.UpgradeName,
tv14.CreateUpgradeHandlerV14(a.mm, a.configurator, a.CommonKeeper, a.AuctionKeeperSkip),
tv14.CreateUpgradeHandlerV14(a.mm, a.configurator, a.CommonKeeper, a.AuctionKeeperSkip, a.LendKeeper),
)
// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
15 changes: 0 additions & 15 deletions app/upgrades/mainnet/v14/constants.go

This file was deleted.

37 changes: 0 additions & 37 deletions app/upgrades/mainnet/v14/upgrades.go

This file was deleted.

13 changes: 13 additions & 0 deletions app/upgrades/testnet/v14/upgrades.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package v14
import (
commonkeeper "github.com/comdex-official/comdex/x/common/keeper"
commontypes "github.com/comdex-official/comdex/x/common/types"
lendkeeper "github.com/comdex-official/comdex/x/lend/keeper"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -17,6 +18,7 @@ func CreateUpgradeHandlerV14(
configurator module.Configurator,
commonkeeper commonkeeper.Keeper,
auctionkeeperskip auctionkeeperskip.Keeper,
lendKeeper lendkeeper.Keeper,

) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
@@ -35,6 +37,8 @@ func CreateUpgradeHandlerV14(
return nil, err
}

//TODO: uncomment this before mainnet upgrade
//UpdateLendParams(ctx, lendKeeper)
return vm, err
}
}
@@ -60,3 +64,12 @@ func getChainBondDenom(chainID string) string {
}
return "stake"
}

func UpdateLendParams(
ctx sdk.Context,
lendKeeper lendkeeper.Keeper,
) {
assetRatesParamsStAtom, _ := lendKeeper.GetAssetRatesParams(ctx, 14)
assetRatesParamsStAtom.CAssetID = 23
lendKeeper.SetAssetRatesParams(ctx, assetRatesParamsStAtom)
}

0 comments on commit dbaa0bb

Please sign in to comment.