Skip to content

Commit

Permalink
fix:issue #35; replace with constants
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0calypse644 committed Jun 19, 2023
1 parent ded6712 commit bbbe359
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions x/keyshare/keeper/msg_server_send_keyshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"encoding/hex"
"fairyring/x/keyshare/types"
"fmt"
distIBE "github.com/FairBlock/DistributedIBE"
"strconv"

distIBE "github.com/FairBlock/DistributedIBE"

"github.com/drand/kyber"
bls "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/pairing"
Expand Down Expand Up @@ -48,7 +49,12 @@ func (k msgServer) SendKeyshare(goCtx context.Context, msg *types.MsgSendKeyshar
return nil, err
}

k.stakingKeeper.Slash(ctx, consAddr, ctx.BlockHeight()-1, 100, sdk.NewDecWithPrec(5, 1))
k.stakingKeeper.Slash(
ctx, consAddr,
ctx.BlockHeight()-1,
types.SlashPower,
sdk.NewDecWithPrec(types.SlashFactorValue, types.SlashFactorPrecision),
)

return &types.MsgSendKeyshareResponse{
Creator: msg.Creator,
Expand Down
6 changes: 6 additions & 0 deletions x/keyshare/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const (
KeyAggregationThresholdDenominator = 3
)

const (

This comment has been minimized.

Copy link
@bowenyou

bowenyou Jun 20, 2023

Member

can we add these as params instead? so that these can just be modified in the future via governance?

This comment has been minimized.

Copy link
@ap0calypse644

ap0calypse644 Jun 23, 2023

Author Contributor

modified in commit 73ad915

SlashPower int64 = 100
SlashFactorValue int64 = 5
SlashFactorPrecision int64 = 10
)

const (
RegisteredValidatorEventType = "new validator-registered"
RegisteredValidatorEventCreator = "creator"
Expand Down

0 comments on commit bbbe359

Please sign in to comment.