From f5dd047c6b91ff549a4cdb3862b4c66a749cd674 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 14 Jul 2023 19:31:31 +0000 Subject: [PATCH] fix: return proper error on ChanCloseInit (#59) (#60) (cherry picked from commit e6e359ee1c2ae8ea23de9dc5c2445b2de4c83403) Co-authored-by: Justin Tieri <37750742+jtieri@users.noreply.github.com> --- modules/async-icq/ibc_module.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/async-icq/ibc_module.go b/modules/async-icq/ibc_module.go index ec1507d2..b4127df8 100644 --- a/modules/async-icq/ibc_module.go +++ b/modules/async-icq/ibc_module.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" @@ -154,7 +155,8 @@ func (im IBCModule) OnChanCloseInit( _ string, _ string, ) error { - return nil + // Ensure channels cannot be closed by users + return errors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") } // OnChanCloseConfirm implements the IBCModule interface