Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ func New(
app.MsgServiceRouter(),
app.BankKeeper,
app.StakingKeeper,
app.SlashingKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

Expand Down
15 changes: 3 additions & 12 deletions x/poa/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ func getBankKeeperMock(t *testing.T, ctx sdk.Context, setExpectations func(ctx s
return bankKeeper
}

func getSlashingKeeperMock(t *testing.T, ctx sdk.Context, setExpectations func(ctx sdk.Context, slashingKeeper *testutil.MockSlashingKeeper)) *testutil.MockSlashingKeeper {
ctrl := gomock.NewController(t)
slashingKeeper := testutil.NewMockSlashingKeeper(ctrl)
setExpectations(ctx, slashingKeeper)
return slashingKeeper
}

func getCtxMock(t *testing.T, key *storetypes.KVStoreKey, tsKey *storetypes.TransientStoreKey) sdk.Context {
setupSdkConfig()

Expand All @@ -69,7 +62,7 @@ func getCtxMock(t *testing.T, key *storetypes.KVStoreKey, tsKey *storetypes.Tran
return ctx
}

func getMockedPoAKeeper(t *testing.T, key *storetypes.KVStoreKey, tsKey *storetypes.TransientStoreKey, ctx sdk.Context, stakingKeeper *testutil.MockStakingKeeper, bankKeeper *testutil.MockBankKeeper, slashingKeeper *testutil.MockSlashingKeeper) *Keeper {
func getMockedPoAKeeper(t *testing.T, key *storetypes.KVStoreKey, tsKey *storetypes.TransientStoreKey, ctx sdk.Context, stakingKeeper *testutil.MockStakingKeeper, bankKeeper *testutil.MockBankKeeper) *Keeper {
encCfg := moduletestutil.MakeTestEncodingConfig()

types.RegisterInterfaces(encCfg.InterfaceRegistry)
Expand All @@ -89,7 +82,6 @@ func getMockedPoAKeeper(t *testing.T, key *storetypes.KVStoreKey, tsKey *storety
msr,
bankKeeper,
stakingKeeper,
slashingKeeper,
"ethm1wunfhl05vc8r8xxnnp8gt62wa54r6y52pg03zq",
)
poaKeeper.SetParams(ctx, types.DefaultParams())
Expand All @@ -99,14 +91,13 @@ func getMockedPoAKeeper(t *testing.T, key *storetypes.KVStoreKey, tsKey *storety
return poaKeeper
}

func setupPoaKeeper(t *testing.T, setStakingExpectations func(ctx sdk.Context, stakingKeeper *testutil.MockStakingKeeper), setBankExpectations func(ctx sdk.Context, bankKeeper *testutil.MockBankKeeper), setSlashingExpectations func(ctx sdk.Context, slashingKeeper *testutil.MockSlashingKeeper)) (*Keeper, sdk.Context) {
func setupPoaKeeper(t *testing.T, setStakingExpectations func(ctx sdk.Context, stakingKeeper *testutil.MockStakingKeeper), setBankExpectations func(ctx sdk.Context, bankKeeper *testutil.MockBankKeeper)) (*Keeper, sdk.Context) {
key := storetypes.NewKVStoreKey(types.StoreKey)
tsKey := storetypes.NewTransientStoreKey("test")

ctx := getCtxMock(t, key, tsKey)
stakingKeeper := getStakingKeeperMock(t, ctx, setStakingExpectations)
bankKeeper := getBankKeeperMock(t, ctx, setBankExpectations)
slashingKeeper := getSlashingKeeperMock(t, ctx, setSlashingExpectations)

return getMockedPoAKeeper(t, key, tsKey, ctx, stakingKeeper, bankKeeper, slashingKeeper), ctx
return getMockedPoAKeeper(t, key, tsKey, ctx, stakingKeeper, bankKeeper), ctx
}
1 change: 0 additions & 1 deletion x/poa/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func TestPoA_Hooks(t *testing.T) {
t,
func(_ sdk.Context, _ *testutil.MockStakingKeeper) {},
func(_ sdk.Context, _ *testutil.MockBankKeeper) {},
func(_ sdk.Context, _ *testutil.MockSlashingKeeper) {},
)

hooks := keeper.Hooks()
Expand Down
115 changes: 0 additions & 115 deletions x/poa/keeper/invariants.go

This file was deleted.

136 changes: 0 additions & 136 deletions x/poa/keeper/invariants_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions x/poa/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type (
router *baseapp.MsgServiceRouter // Msg server router
bk types.BankKeeper
sk types.StakingKeeper
ck types.SlashingKeeper
}
)

Expand All @@ -38,7 +37,6 @@ func NewKeeper(
router *baseapp.MsgServiceRouter,
bk types.BankKeeper,
sk types.StakingKeeper,
ck types.SlashingKeeper,
authority string,
) *Keeper {
// set KeyTable if it has not already been set
Expand All @@ -58,7 +56,6 @@ func NewKeeper(
router: router,
bk: bk,
sk: sk,
ck: ck,
}
}

Expand Down
4 changes: 1 addition & 3 deletions x/poa/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ func poaKeeperTestSetup(t *testing.T) (*Keeper, sdk.Context) {
bankKeeper.EXPECT().SendCoinsFromAccountToModule(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
}

slashingExpectations := func(_ sdk.Context, _ *testutil.MockSlashingKeeper) {}

return setupPoaKeeper(t, stakingExpectations, bankExpectations, slashingExpectations)
return setupPoaKeeper(t, stakingExpectations, bankExpectations)
}

// Define here Keeper methods to be unit tested
Expand Down
4 changes: 1 addition & 3 deletions x/poa/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
}

// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted)
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
keeper.RegisterInvariants(ir, am.keeper)
}
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// InitGenesis performs the module's genesis initialization. It returns no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) {
Expand Down