Skip to content

Commit

Permalink
feat(distr): add set ubi keeper func (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHansLee authored Oct 18, 2024
1 parent f2cbdd9 commit 2cd4bd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions x/distribution/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ func (k Keeper) GetUbi(ctx context.Context) (math.LegacyDec, error) {
return params.Ubi, nil
}

// SetUbi sets new ubi
func (k Keeper) SetUbi(ctx context.Context, newUbi math.LegacyDec) error {
params, err := k.Params.Get(ctx)
if err != nil {
return err
}

params.Ubi = newUbi

return k.Params.Set(ctx, params)
}

// GetWithdrawAddrEnabled returns the current distribution withdraw address
// enabled parameter.
func (k Keeper) GetWithdrawAddrEnabled(ctx context.Context) (enabled bool, err error) {
Expand Down
2 changes: 1 addition & 1 deletion x/staking/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (k msgServer) EditValidator(ctx context.Context, msg *types.MsgEditValidato
}

if msg.MinSelfDelegation != nil {
if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) {
if !msg.MinSelfDelegation.GTE(validator.MinSelfDelegation) {
return nil, types.ErrMinSelfDelegationDecreased
}

Expand Down

0 comments on commit 2cd4bd8

Please sign in to comment.