Skip to content

Commit

Permalink
Merge branch 'main' into fix/swap-amount-out-open-estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond authored Feb 14, 2024
2 parents 47bcd5d + 3662c43 commit 8599e64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 2 additions & 3 deletions x/stablestake/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {

func (k Keeper) GetDepositDenom(ctx sdk.Context) string {
params := k.GetParams(ctx)
depositDenom := params.DepositDenom
entry, found := k.assetProfileKeeper.GetEntry(ctx, params.DepositDenom)
if !found {
depositDenom = entry.Denom
return params.DepositDenom
}
return depositDenom
return entry.Denom
}
13 changes: 13 additions & 0 deletions x/stablestake/migrations/v3_migration.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package migrations

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (m Migrator) V3Migration(ctx sdk.Context) error {
params := m.keeper.GetParams(ctx)
params.InterestRateMin = sdk.NewDecWithPrec(10, 2) // 10%
params.InterestRateMax = sdk.NewDecWithPrec(50, 2) // 50%
m.keeper.SetParams(ctx, params)
return nil
}
2 changes: 1 addition & 1 deletion x/stablestake/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
m := migrations.NewMigrator(am.keeper)
err := cfg.RegisterMigration(types.ModuleName, 1, m.V2Migration)
err := cfg.RegisterMigration(types.ModuleName, 2, m.V3Migration)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 8599e64

Please sign in to comment.