Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher142 committed Aug 18, 2020
1 parent a98d3ee commit 2c44892
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions x/slashing/handler_sidechain.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ func handleMsgBscSubmitEvidence(ctx sdk.Context, msg MsgBscSubmitEvidence, k Kee
}
}

jailUtil := header.Time.Add(k.DoubleSignUnbondDuration(sideCtx))
jailUntil := header.Time.Add(k.DoubleSignUnbondDuration(sideCtx))
sr := SlashRecord{
ConsAddr: sideConsAddr.Bytes(),
InfractionType: DoubleSign,
InfractionHeight: uint64(msg.Headers[0].Number),
SlashHeight: header.Height,
JailUntil: jailUtil,
JailUntil: jailUntil,
SlashAmt: slashedAmount.RawInt(),
SideChainId: sideChainId,
}
Expand All @@ -94,7 +94,7 @@ func handleMsgBscSubmitEvidence(ctx sdk.Context, msg MsgBscSubmitEvidence, k Kee
if !found {
panic(fmt.Sprintf("Expected signing info for validator %s but not found", sideConsAddr.Hex()))
}
signInfo.JailedUntil = jailUtil
signInfo.JailedUntil = jailUntil
k.setValidatorSigningInfo(sideCtx, sideConsAddr.Bytes(), signInfo)

if ctx.IsDeliverTx() && k.PbsbServer != nil {
Expand All @@ -103,7 +103,7 @@ func handleMsgBscSubmitEvidence(ctx sdk.Context, msg MsgBscSubmitEvidence, k Kee
InfractionType: DoubleSign,
InfractionHeight: msg.Headers[0].Number,
SlashHeight: header.Height,
JailUtil: jailUtil,
JailUtil: jailUntil,
SlashAmt: slashedAmount.RawInt(),
SideChainId: sideChainId,
ToFeePool: toFeePool,
Expand Down
2 changes: 0 additions & 2 deletions x/stake/keeper/distribute_sidechain.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/stake/types"
)

const threshold = 5

func (k Keeper) Distribute(ctx sdk.Context, sideChainId string) {

// The rewards collected yesterday is decided by the validators the day before yesterday.
Expand Down
7 changes: 5 additions & 2 deletions x/stake/keeper/reward.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/stake/types"
"math"
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/stake/types"
)

const threshold = 5

func allocate(sharers []types.Sharer, totalRewards sdk.Dec, totalShares sdk.Dec) (rewards []types.Reward) {
var minToDistribute int64
var shouldCarry []types.Reward
Expand Down

0 comments on commit 2c44892

Please sign in to comment.