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

Regen Network/Slashing protobuf #5627

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
76757e0
Add protobuf def
anilcse Feb 7, 2020
a0eaa7a
Add proto msg type for MsgUnJail
anilcse Feb 7, 2020
0c6ca19
gofmt
anilcse Feb 7, 2020
ab7fc9e
Merge pull request #21 from regen-network/vw/slashing_protobuf_migration
anilcse Feb 7, 2020
fbf33e8
Merge branch 'master' of github.com:cosmos/cosmos-sdk into vw/slashin…
anilcse Feb 7, 2020
e8617dc
Remove ModuleCodec
anilcse Feb 7, 2020
3b7110b
Merge branch 'regen-network/slashing_protobuf' of github.com:regen-ne…
anilcse Feb 7, 2020
89b5834
Add changelog
anilcse Feb 11, 2020
1cb8cc8
Fix naming
anilcse Feb 11, 2020
2909f11
Fix undefined errors
anilcse Feb 11, 2020
c9ddfbd
Add ValidatorSigningInfo protobuf implementation
anilcse Feb 11, 2020
d286da4
Revert unnecessary codec migration
anilcse Feb 11, 2020
c601f08
Add protobuf def
anilcse Feb 7, 2020
af6b876
Add proto msg type for MsgUnJail
anilcse Feb 7, 2020
5fb7442
gofmt
anilcse Feb 7, 2020
25f7f97
Remove ModuleCodec
anilcse Feb 7, 2020
12111ae
Add changelog
anilcse Feb 11, 2020
af95b29
Fix naming
anilcse Feb 11, 2020
ba3ee92
Fix undefined errors
anilcse Feb 11, 2020
d90bb3e
Add ValidatorSigningInfo protobuf implementation
anilcse Feb 11, 2020
2ca862f
Revert unnecessary codec migration
anilcse Feb 11, 2020
5395ce8
Merge branch 'regen-network/slashing_protobuf' of github.com:regen-ne…
anilcse Feb 11, 2020
21b9cba
Add ValidatorSigningInfo proto codec
anilcse Feb 11, 2020
5a5fd73
Fix keeper init in tests
anilcse Feb 11, 2020
bdd9368
Add TODO
anilcse Feb 11, 2020
525ad52
Fix signing-info migration
anilcse Feb 11, 2020
c6bb9ae
Change query to use protobuf codec
anilcse Feb 11, 2020
486e7a1
Fix unjail testscript
anilcse Feb 11, 2020
d035a18
Fix go-imports
anilcse Feb 11, 2020
5130ecd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 11, 2020
bb6d8c8
Migrate all slashing queries to use protobuf
anilcse Feb 11, 2020
3dac3b6
Fix typecast
anilcse Feb 11, 2020
6d62019
Fix gofmt
anilcse Feb 11, 2020
ef7cb62
Gofmt
anilcse Feb 11, 2020
9ce0db2
Use protobuf types
anilcse Feb 12, 2020
ae47cb7
Revert
anilcse Feb 12, 2020
30673c0
Revert query params
anilcse Feb 12, 2020
1480c46
Revert query, tx
anilcse Feb 12, 2020
606dd29
Fix lint issue
anilcse Feb 12, 2020
07815e1
Update changelog
anilcse Feb 12, 2020
247af97
Fix lint issues
anilcse Feb 12, 2020
4628a98
Fix lint issues
anilcse Feb 12, 2020
24addfa
Merge pull request #24 from regen-network/regen-network/slashing_prot…
anilcse Feb 12, 2020
b111389
Removed new line
sahith-narahari Feb 12, 2020
e870c7b
Merge pull request #25 from regen-network/anil/fix_slashing_simulatio…
anilcse Feb 12, 2020
e3897cf
Fix golint
anilcse Feb 12, 2020
8fbc455
Fix use json and yaml tags the same as before
anilcse Feb 12, 2020
32aa41b
Merge branch 'regen-network/slashing_protobuf' of github.com:regen-ne…
anilcse Feb 12, 2020
cd0b99d
Merge pull request #26 from regen-network/regen-network/slashing_prot…
anilcse Feb 12, 2020
fb1a0da
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 12, 2020
33bc104
Merge branch 'regen-network/slashing_protobuf' of github.com:regen-ne…
anilcse Feb 12, 2020
750e613
Fix gofmt
anilcse Feb 12, 2020
53b45e0
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 16, 2020
5b9cc9f
Gofmt
anilcse Feb 16, 2020
ae52ace
Fix test-sim-import-export issue
anilcse Feb 16, 2020
28e2556
Fix gofmt
anilcse Feb 16, 2020
7e34c0c
Merge branch 'master' into regen-network/slashing_protobuf
anilcse Feb 16, 2020
e68f3f0
- Rebase to cosmos:master
anilcse Feb 18, 2020
4360aee
Fix typo
anilcse Feb 18, 2020
04ff0b5
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 18, 2020
85b3a20
Revert str conv
anilcse Feb 18, 2020
47c5fb5
Fix gofmt
anilcse Feb 18, 2020
65b5622
Merge branch 'master' into regen-network/slashing_protobuf
anilcse Feb 18, 2020
9e7b6ed
Fix review changes
anilcse Feb 19, 2020
a836c0e
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 19, 2020
db992df
Remove unused codec alias
anilcse Feb 19, 2020
73271ff
Merge branch 'regen-network/slashing_protobuf' of github.com:regen-ne…
anilcse Feb 19, 2020
e5f10e1
Revert
anilcse Feb 19, 2020
4c5e070
fix import
anilcse Feb 19, 2020
44559dd
Merge branch 'master' of github.com:cosmos/cosmos-sdk into regen-netw…
anilcse Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ for JSON encoding.
* Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`.
* The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type
provided is specified by `ModuleCdc`.
* (x/slashing) [\#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state
serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino
for JSON encoding.
* The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type
provided is specified by `ModuleCdc`.
* (x/distribution) [\#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state
serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino
for JSON encoding.
Expand Down
2 changes: 1 addition & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func NewSimApp(
app.SupplyKeeper, auth.FeeCollectorName, app.ModuleAccountAddrs(),
)
app.SlashingKeeper = slashing.NewKeeper(
app.cdc, keys[slashing.StoreKey], &stakingKeeper, app.subspaces[slashing.ModuleName],
appCodec, keys[slashing.StoreKey], &stakingKeeper, app.subspaces[slashing.ModuleName],
)
app.CrisisKeeper = crisis.NewKeeper(
app.subspaces[crisis.ModuleName], invCheckPeriod, app.SupplyKeeper, auth.FeeCollectorName,
Expand Down
2 changes: 1 addition & 1 deletion types/proto.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types

import (
_ "github.com/gogo/protobuf/gogoproto" // nolint
_ "github.com/gogo/protobuf/gogoproto" // nolint
_ "github.com/regen-network/cosmos-proto" // nolint
)

Expand Down
2 changes: 1 addition & 1 deletion x/slashing/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/internal/keeper"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
"github.com/cosmos/cosmos-sdk/x/staking"
)

Expand Down
4 changes: 2 additions & 2 deletions x/slashing/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package slashing
// nolint

import (
"github.com/cosmos/cosmos-sdk/x/slashing/internal/keeper"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/keeper"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

const (
Expand Down
8 changes: 6 additions & 2 deletions x/slashing/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// GetQueryCmd returns the cli query commands for this module
Expand Down Expand Up @@ -68,7 +68,11 @@ $ <appcli> query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdge
}

var signingInfo types.ValidatorSigningInfo
cdc.MustUnmarshalBinaryLengthPrefixed(res, &signingInfo)
signingInfo, err = types.UnmarshalValSigningInfo(types.ModuleCdc, res)
if err != nil {
return err
}

return cliCtx.PrintOutput(signingInfo)
},
}
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// GetTxCmd returns the transaction commands for this module
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) {
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/client/rest/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
authclient "github.com/cosmos/cosmos-sdk/x/auth/client"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router) {
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package slashing

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking/exported"
)

Expand Down
2 changes: 1 addition & 1 deletion x/slashing/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package slashing
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// NewHandler creates an sdk.Handler for all the slashing type messages
Expand Down
4 changes: 2 additions & 2 deletions x/slashing/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/internal/keeper"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
)

Expand Down
20 changes: 0 additions & 20 deletions x/slashing/internal/types/codec.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/tendermint/tendermint/crypto"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/tendermint/tendermint/crypto"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// HandleValidatorSignature handles a validator signature, must be called once per validator per block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ package keeper
import (
"fmt"

gogotypes "github.com/gogo/protobuf/types"

"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// Keeper of the slashing store
type Keeper struct {
storeKey sdk.StoreKey
cdc *codec.Codec
cdc codec.Marshaler
sk types.StakingKeeper
paramspace types.ParamSubspace
}

// NewKeeper creates a slashing keeper
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.StakingKeeper, paramspace types.ParamSubspace) Keeper {
func NewKeeper(cdc codec.Marshaler, key sdk.StoreKey, sk types.StakingKeeper, paramspace types.ParamSubspace) Keeper {
return Keeper{
storeKey: key,
cdc: cdc,
Expand All @@ -37,18 +39,31 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
// AddPubkey sets a address-pubkey relation
func (k Keeper) AddPubkey(ctx sdk.Context, pubkey crypto.PubKey) {
addr := pubkey.Address()
k.setAddrPubkeyRelation(ctx, addr, pubkey)

pkStr, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pubkey)
if err != nil {
panic(fmt.Errorf("error while setting address-pubkey relation: %s", addr))
}

k.setAddrPubkeyRelation(ctx, addr, pkStr)
}

// GetPubkey returns the pubkey from the adddress-pubkey relation
func (k Keeper) GetPubkey(ctx sdk.Context, address crypto.Address) (crypto.PubKey, error) {
store := ctx.KVStore(k.storeKey)
var pubkey crypto.PubKey

var pubkey gogotypes.StringValue
err := k.cdc.UnmarshalBinaryLengthPrefixed(store.Get(types.GetAddrPubkeyRelationKey(address)), &pubkey)
if err != nil {
return nil, fmt.Errorf("address %s not found", sdk.ConsAddress(address))
}
return pubkey, nil

pkStr, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, pubkey.Value)
if err != nil {
return pkStr, err
}

return pkStr, nil
}

// Slash attempts to slash a validator. The slash is delegated to the staking
Expand Down Expand Up @@ -79,9 +94,10 @@ func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress) {
k.sk.Jail(ctx, consAddr)
}

func (k Keeper) setAddrPubkeyRelation(ctx sdk.Context, addr crypto.Address, pubkey crypto.PubKey) {
func (k Keeper) setAddrPubkeyRelation(ctx sdk.Context, addr crypto.Address, pubkey string) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshalBinaryLengthPrefixed(pubkey)

bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.StringValue{Value: pubkey})
store.Set(types.GetAddrPubkeyRelationKey(addr), bz)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// SignedBlocksWindow - sliding window for downtime slashing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// NewQuerier creates a new querier for slashing clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

func TestNewQuerier(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package keeper
import (
"time"

gogotypes "github.com/gogo/protobuf/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// GetValidatorSigningInfo retruns the ValidatorSigningInfo for a specific validator
Expand All @@ -31,7 +33,7 @@ func (k Keeper) HasValidatorSigningInfo(ctx sdk.Context, consAddr sdk.ConsAddres
// SetValidatorSigningInfo sets the validator signing info to a consensus address key
func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshalBinaryLengthPrefixed(info)
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&info)
store.Set(types.GetValidatorSigningInfoKey(address), bz)
}

Expand All @@ -53,16 +55,17 @@ func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context,
}

// GetValidatorMissedBlockBitArray gets the bit for the missed blocks array
func (k Keeper) GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64) (missed bool) {
func (k Keeper) GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64) bool {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.GetValidatorMissedBlockBitArrayKey(address, index))
var missed gogotypes.BoolValue
if bz == nil {
// lazy: treat empty key as not missed
missed = false
return
return false
}
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &missed)
return

return missed.Value
}

// IterateValidatorMissedBlockBitArray iterates over the signed blocks window
Expand All @@ -74,13 +77,14 @@ func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context,
index := int64(0)
// Array may be sparse
for ; index < k.SignedBlocksWindow(ctx); index++ {
var missed bool
var missed gogotypes.BoolValue
bz := store.Get(types.GetValidatorMissedBlockBitArrayKey(address, index))
if bz == nil {
continue
}

k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &missed)
if handler(index, missed) {
if handler(index, missed.Value) {
break
}
}
Expand Down Expand Up @@ -128,7 +132,7 @@ func (k Keeper) IsTombstoned(ctx sdk.Context, consAddr sdk.ConsAddress) bool {
// missed a block in the current window
func (k Keeper) SetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64, missed bool) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshalBinaryLengthPrefixed(missed)
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.BoolValue{Value: missed})
store.Set(types.GetValidatorMissedBlockBitArrayKey(address, index), bz)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

func TestGetSetValidatorSigningInfo(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/params/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/supply"
)
Expand Down Expand Up @@ -124,7 +124,7 @@ func CreateTestInput(t *testing.T, defaults types.Params) (sdk.Context, bank.Kee
}

paramstore := paramsKeeper.Subspace(types.DefaultParamspace)
keeper := NewKeeper(cdc, keySlashing, &sk, paramstore)
keeper := NewKeeper(types.ModuleCdc, keySlashing, &sk, paramstore)

keeper.SetParams(ctx, defaults)
sk.SetHooks(keeper.Hooks())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
)

// Unjail calls the staking Unjail function to unjail a validator if the
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
sim "github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/cosmos/cosmos-sdk/x/slashing/client/cli"
"github.com/cosmos/cosmos-sdk/x/slashing/client/rest"
"github.com/cosmos/cosmos-sdk/x/slashing/internal/types"
"github.com/cosmos/cosmos-sdk/x/slashing/simulation"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
)

Expand Down
Loading