Skip to content

Commit 6e5a91d

Browse files
authored
feat(distr): add set ubi keeper func (#12)
1 parent c603598 commit 6e5a91d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

x/distribution/keeper/params.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ func (k Keeper) GetUbi(ctx context.Context) (math.LegacyDec, error) {
1616
return params.Ubi, nil
1717
}
1818

19+
// SetUbi sets new ubi
20+
func (k Keeper) SetUbi(ctx context.Context, newUbi math.LegacyDec) error {
21+
params, err := k.Params.Get(ctx)
22+
if err != nil {
23+
return err
24+
}
25+
26+
params.Ubi = newUbi
27+
28+
return k.Params.Set(ctx, params)
29+
}
30+
1931
// GetWithdrawAddrEnabled returns the current distribution withdraw address
2032
// enabled parameter.
2133
func (k Keeper) GetWithdrawAddrEnabled(ctx context.Context) (enabled bool, err error) {

x/staking/keeper/msg_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (k msgServer) EditValidator(ctx context.Context, msg *types.MsgEditValidato
241241
}
242242

243243
if msg.MinSelfDelegation != nil {
244-
if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) {
244+
if !msg.MinSelfDelegation.GTE(validator.MinSelfDelegation) {
245245
return nil, types.ErrMinSelfDelegationDecreased
246246
}
247247

0 commit comments

Comments
 (0)