Skip to content

Commit

Permalink
add migration for interest range from 10% - 50%
Browse files Browse the repository at this point in the history
  • Loading branch information
jelysn committed Feb 14, 2024
1 parent a185030 commit 4c5fb2c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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 4c5fb2c

Please sign in to comment.