Skip to content

Commit

Permalink
add edit validator check for MsgExec
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Mar 11, 2024
1 parent ec9105c commit 89420a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x/dyncomm/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
dyncommkeeper "github.com/classic-terra/core/v2/x/dyncomm/keeper"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authz "github.com/cosmos/cosmos-sdk/x/authz"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)
Expand Down Expand Up @@ -41,9 +42,14 @@ func (dd DyncommDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool,
func (dd DyncommDecorator) FilterMsgsAndProcessMsgs(ctx sdk.Context, msgs ...sdk.Msg) (err error) {
for _, msg := range msgs {

switch msg.(type) {
switch msg := msg.(type) {
case *stakingtypes.MsgEditValidator:
err = dd.ProcessEditValidator(ctx, msg)
case *authz.MsgExec:
messages, msgerr := msg.GetMessages()
if msgerr == nil {
err = dd.FilterMsgsAndProcessMsgs(ctx, messages...)
}
default:
continue
}
Expand Down

0 comments on commit 89420a4

Please sign in to comment.