diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index bfa45d23f64e..7c8b7de20d5e 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -131,6 +131,11 @@ func (k BaseKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccA return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) } + moduleAccAddr, err := k.sendRestriction.apply(ctx, delegatorAddr, moduleAccAddr, amt) + if err != nil { + return err + } + balances := sdk.NewCoins() for _, coin := range amt { @@ -157,7 +162,7 @@ func (k BaseKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccA types.NewCoinSpentEvent(delegatorAddr, amt), ) - err := k.addCoins(ctx, moduleAccAddr, amt) + err = k.addCoins(ctx, moduleAccAddr, amt) if err != nil { return err } @@ -180,7 +185,12 @@ func (k BaseKeeper) UndelegateCoins(ctx context.Context, moduleAccAddr, delegato return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) } - err := k.subUnlockedCoins(ctx, moduleAccAddr, amt) + delegatorAddr, err := k.sendRestriction.apply(ctx, moduleAccAddr, delegatorAddr, amt) + if err != nil { + return err + } + + err = k.subUnlockedCoins(ctx, moduleAccAddr, amt) if err != nil { return err }