Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Tags Cleanup & Docs #3137

Merged
merged 15 commits into from
Dec 20, 2018
Prev Previous commit
Next Next commit
Remove dup tag from x/slashing BeginBlocker
  • Loading branch information
Aleksandr Bezobchuk committed Dec 17, 2018
commit ba70cc449df853a8ae44221d09df58a0228ef207
11 changes: 3 additions & 8 deletions x/slashing/tick.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package slashing

import (
"encoding/binary"
"fmt"

abci "github.com/tendermint/tendermint/abci/types"
Expand All @@ -11,12 +10,8 @@ import (
)

// slashing begin block functionality
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags sdk.Tags) {

// Tag the height
heightBytes := make([]byte, 8)
binary.LittleEndian.PutUint64(heightBytes, uint64(req.Header.Height))
tags = sdk.NewTags("height", heightBytes)
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) sdk.Tags {
tags := sdk.NewTags("slashing-height", []byte(fmt.Sprintf("%d", req.Header.Height)))

// Iterate over all the validators which *should* have signed this block
// store whether or not they have actually signed it and slash/unbond any
Expand All @@ -37,5 +32,5 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags
}
}

return
return tags
}