Skip to content

Commit

Permalink
remove observerslash amount from param keys for emissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Mar 7, 2024
1 parent 1f8f76f commit 0ec62f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion x/emissions/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func DistributeObserverRewards(ctx sdk.Context, amount sdkmath.Int, keeper keepe
continue
}
if observerRewardUnits < 0 {
slashAmount := keeper.GetParams(ctx).ObserverSlashAmount
slashAmount, ok := sdkmath.NewIntFromString(types.ObserverSlashAmount)
if !ok {
continue
}
keeper.SlashObserverEmission(ctx, observerAddress.String(), slashAmount)
finalDistributionList = append(finalDistributionList, &types.ObserverEmission{
EmissionType: types.EmissionType_Slash,
Expand Down
2 changes: 2 additions & 0 deletions x/emissions/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const (

EmissionScheduledYears = 4
AvgBlockTime = "5.7"

ObserverSlashAmount = "100000000000000000"
)

func KeyPrefix(p string) []byte {
Expand Down
2 changes: 1 addition & 1 deletion x/emissions/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
paramtypes.NewParamSetPair(KeyPrefix(ParamObserverEmissionPercentage), &p.ObserverEmissionPercentage, validateObserverEmissionPercentage),
paramtypes.NewParamSetPair(KeyPrefix(ParamTssSignerEmissionPercentage), &p.TssSignerEmissionPercentage, validateTssEmissonPercentage),
paramtypes.NewParamSetPair(KeyPrefix(ParamDurationFactorConstant), &p.DurationFactorConstant, validateDurationFactorConstant),
paramtypes.NewParamSetPair(KeyPrefix(ParamObserverSlashAmount), &p.ObserverSlashAmount, validateObserverSlashAmount),
//paramtypes.NewParamSetPair(KeyPrefix(ParamObserverSlashAmount), &p.ObserverSlashAmount, validateObserverSlashAmount),
}
}

Expand Down

0 comments on commit 0ec62f9

Please sign in to comment.