From 0fd559e42d59886b8df2b98575c70cb591c2ba70 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:33:06 +0200 Subject: [PATCH] x/ibc: minor fixes (#6621) --- x/ibc/03-connection/handler.go | 8 ++++---- x/ibc/03-connection/keeper/keeper.go | 20 -------------------- x/ibc/03-connection/types/events.go | 8 ++++---- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/x/ibc/03-connection/handler.go b/x/ibc/03-connection/handler.go index c180579db..86d597252 100644 --- a/x/ibc/03-connection/handler.go +++ b/x/ibc/03-connection/handler.go @@ -20,7 +20,7 @@ func HandleMsgConnectionOpenInit(ctx sdk.Context, k keeper.Keeper, msg *types.Ms sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionID), sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientID), sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientID), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnetionID, msg.Counterparty.ConnectionID), + sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionID), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -49,7 +49,7 @@ func HandleMsgConnectionOpenTry(ctx sdk.Context, k keeper.Keeper, msg *types.Msg sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionID), sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientID), sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientID), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnetionID, msg.Counterparty.ConnectionID), + sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionID), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -79,7 +79,7 @@ func HandleMsgConnectionOpenAck(ctx sdk.Context, k keeper.Keeper, msg *types.Msg sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionID), sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientID), sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientID), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnetionID, connectionEnd.Counterparty.ConnectionID), + sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionID), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -108,7 +108,7 @@ func HandleMsgConnectionOpenConfirm(ctx sdk.Context, k keeper.Keeper, msg *types sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionID), sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientID), sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientID), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnetionID, connectionEnd.Counterparty.ConnectionID), + sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionID), ), sdk.NewEvent( sdk.EventTypeMessage, diff --git a/x/ibc/03-connection/keeper/keeper.go b/x/ibc/03-connection/keeper/keeper.go index 2d116911c..ed0a28dcc 100644 --- a/x/ibc/03-connection/keeper/keeper.go +++ b/x/ibc/03-connection/keeper/keeper.go @@ -171,23 +171,3 @@ func (k Keeper) addConnectionToClient(ctx sdk.Context, clientID, connectionID st k.SetClientConnectionPaths(ctx, clientID, conns) return nil } - -// removeConnectionFromClient is used to remove a connection identifier from the -// set of connections associated with a client. -// -// CONTRACT: client must already exist -// nolint: unused -func (k Keeper) removeConnectionFromClient(ctx sdk.Context, clientID, connectionID string) error { - conns, found := k.GetClientConnectionPaths(ctx, clientID) - if !found { - return sdkerrors.Wrap(types.ErrClientConnectionPathsNotFound, clientID) - } - - conns, ok := host.RemovePath(conns, connectionID) - if !ok { - return sdkerrors.Wrap(types.ErrConnectionPath, clientID) - } - - k.SetClientConnectionPaths(ctx, clientID, conns) - return nil -} diff --git a/x/ibc/03-connection/types/events.go b/x/ibc/03-connection/types/events.go index f2521bb9e..00fbb4d7a 100644 --- a/x/ibc/03-connection/types/events.go +++ b/x/ibc/03-connection/types/events.go @@ -8,10 +8,10 @@ import ( // IBC connection events const ( - AttributeKeyConnectionID = "connection_id" - AttributeKeyClientID = "client_id" - AttributeKeyCounterpartyClientID = "counterparty_client_id" - AttributeKeyCounterpartyConnetionID = "counterparty_connection_id" + AttributeKeyConnectionID = "connection_id" + AttributeKeyClientID = "client_id" + AttributeKeyCounterpartyClientID = "counterparty_client_id" + AttributeKeyCounterpartyConnectionID = "counterparty_connection_id" ) // IBC connection events vars