Skip to content

Commit

Permalink
slashing
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Oct 21, 2024
1 parent 0e953b1 commit 2b9ff60
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 62 deletions.
7 changes: 4 additions & 3 deletions x/slashing/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

modulev1 "cosmossdk.io/api/cosmos/slashing/module/v1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/comet"
"cosmossdk.io/depinject"
Expand Down Expand Up @@ -37,8 +38,8 @@ type ModuleInputs struct {
Cdc codec.Codec
Registry cdctypes.InterfaceRegistry
CometService comet.Service
AddressCdc address.Codec

AccountKeeper types.AccountKeeper
BankKeeper types.BankKeeper
StakingKeeper types.StakingKeeper
}
Expand All @@ -58,13 +59,13 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority)
}

authStr, err := in.AccountKeeper.AddressCodec().BytesToString(authority)
authStr, err := in.AddressCdc.BytesToString(authority)
if err != nil {
panic(fmt.Errorf("unable to decode authority in slashing: %w", err))
}

k := keeper.NewKeeper(in.Environment, in.Cdc, nil, in.StakingKeeper, authStr)
m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, in.Registry, in.CometService)
m := NewAppModule(in.Cdc, k, in.BankKeeper, in.StakingKeeper, in.Registry, in.CometService)
return ModuleOutputs{
Keeper: k,
Module: m,
Expand Down
1 change: 1 addition & 0 deletions x/slashing/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/api => ../../api
cosmossdk.io/core => ../../core
cosmossdk.io/store => ../../store
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/staking => ../staking
Expand Down
1 change: 0 additions & 1 deletion x/slashing/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ type AppModule struct {
func NewAppModule(
cdc codec.Codec,
keeper keeper.Keeper,
ak types.AccountKeeper,
bk types.BankKeeper,
sk types.StakingKeeper,
registry cdctypes.InterfaceRegistry,
Expand Down
52 changes: 0 additions & 52 deletions x/slashing/testutil/expected_keepers_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions x/slashing/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// AccountKeeper expected account keeper
type AccountKeeper interface {
AddressCodec() address.Codec
GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
}

// BankKeeper defines the expected interface needed to retrieve account balances.
type BankKeeper interface {
GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
Expand Down

0 comments on commit 2b9ff60

Please sign in to comment.