Skip to content
Merged
2 changes: 2 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func NewAnteHandlerOptionsFromApp(app *App, txConfig client.TxConfig, maxGasWant
AuthzDisabledMsgTypes: []string{
sdk.MsgTypeURL(&stakingtypes.MsgUndelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgCancelUnbondingDelegation{}),
sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}),
},
}
}
Expand Down
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ func New(
stakingtypes.NewMultiStakingHooks(
app.DistrKeeper.Hooks(),
app.SlashingKeeper.Hooks(),
app.PoaKeeper.Hooks(),
),
)
// register the staking hooks
Expand All @@ -459,7 +458,6 @@ func New(
app.MsgServiceRouter(),
app.BankKeeper,
app.StakingKeeper,
app.SlashingKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

Expand Down
4 changes: 3 additions & 1 deletion x/poa/ante/poa.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ func (cbd PoaDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
// loop through all the messages and check if the message type is allowed
for _, msg := range tx.GetMsgs() {
if sdk.MsgTypeURL(msg) == sdk.MsgTypeURL(&stakingtypes.MsgUndelegate{}) ||
sdk.MsgTypeURL(msg) == sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}) {
sdk.MsgTypeURL(msg) == sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}) ||
sdk.MsgTypeURL(msg) == sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}) ||
sdk.MsgTypeURL(msg) == sdk.MsgTypeURL(&stakingtypes.MsgCancelUnbondingDelegation{}) {
return ctx, errors.New("tx type not allowed")
}
}
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
}
71 changes: 0 additions & 71 deletions x/poa/keeper/hooks.go

This file was deleted.

45 changes: 0 additions & 45 deletions x/poa/keeper/hooks_test.go

This file was deleted.

115 changes: 0 additions & 115 deletions x/poa/keeper/invariants.go

This file was deleted.

Loading