From e6e359ee1c2ae8ea23de9dc5c2445b2de4c83403 Mon Sep 17 00:00:00 2001 From: Justin Tieri <37750742+jtieri@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:13:50 -0500 Subject: [PATCH] fix: return proper error on ChanCloseInit (#59) --- 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 20a8ed96..0e80592f 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/v7/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