-
Notifications
You must be signed in to change notification settings - Fork 197
/
gov.go
34 lines (26 loc) · 846 Bytes
/
gov.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/Stride-Labs/stride/v22/x/stakeibc/types"
)
func (k Keeper) AddValidatorsProposal(ctx sdk.Context, msg *types.AddValidatorsProposal) error {
for _, validator := range msg.Validators {
if err := k.AddValidatorToHostZone(ctx, msg.HostZone, *validator, true); err != nil {
return err
}
}
// Confirm none of the validator's exceed the weight cap
if err := k.CheckValidatorWeightsBelowCap(ctx, msg.HostZone); err != nil {
return err
}
return nil
}
func (k Keeper) ToggleLSMProposal(ctx sdk.Context, msg *types.ToggleLSMProposal) error {
hostZone, found := k.GetHostZone(ctx, msg.HostZone)
if !found {
return types.ErrHostZoneNotFound.Wrap(msg.HostZone)
}
hostZone.LsmLiquidStakeEnabled = msg.Enabled
k.SetHostZone(ctx, hostZone)
return nil
}