Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions x/gov/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"cosmossdk.io/errors"
"cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors1 "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -187,9 +188,16 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *v1.MsgUpdateParams)

// before params change, trigger an update of the last min deposit
minDeposit := k.GetMinDeposit(ctx)
k.SetLastMinDeposit(ctx, minDeposit, ctx.BlockTime())
newMinDeposit := v1.GetNewMinDeposit(msg.Params.MinDepositThrottler.FloorValue, minDeposit, math.LegacyOneDec())
if !minDeposit.Equal(newMinDeposit) {
k.SetLastMinDeposit(ctx, newMinDeposit, ctx.BlockTime())
}

minInitialDeposit := k.GetMinInitialDeposit(ctx)
k.SetLastMinInitialDeposit(ctx, minInitialDeposit, ctx.BlockTime())
newMinInitialDeposit := v1.GetNewMinDeposit(msg.Params.MinInitialDepositThrottler.FloorValue, minInitialDeposit, math.LegacyOneDec())
if !minInitialDeposit.Equal(newMinInitialDeposit) {
k.SetLastMinInitialDeposit(ctx, newMinInitialDeposit, ctx.BlockTime())
}

if err := k.SetParams(ctx, msg.Params); err != nil {
return nil, err
Expand Down
Loading