From 78c77624ecbe950fc13c35a879649831ff016b60 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Thu, 31 Oct 2024 09:01:20 +0200 Subject: [PATCH] fix: remove stale todos --- x/interchaintxs/keeper/ibc_handlers.go | 6 ------ x/interchaintxs/keeper/msg_server.go | 14 -------------- x/interchaintxs/types/tx.go | 5 ----- x/transfer/ibc_handlers.go | 6 ------ x/transfer/keeper/keeper.go | 9 --------- x/transfer/types/tx.go | 7 ------- 6 files changed, 47 deletions(-) diff --git a/x/interchaintxs/keeper/ibc_handlers.go b/x/interchaintxs/keeper/ibc_handlers.go index b1fb41fe..963235e9 100644 --- a/x/interchaintxs/keeper/ibc_handlers.go +++ b/x/interchaintxs/keeper/ibc_handlers.go @@ -36,9 +36,6 @@ func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Pack return errors.Wrapf(sdkerrors.ErrJSONMarshal, "failed to marshal Packet/Acknowledgment: %v", err) } - // TODO remove feekeeper module - // k.feeKeeper.DistributeAcknowledgementFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence)) - // Actually we have only one kind of error returned from acknowledgement // maybe later we'll retrieve actual errors from events _, err = k.sudoKeeper.Sudo(ctx, icaOwner.GetContract(), msg) @@ -65,9 +62,6 @@ func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, rela return errors.Wrapf(sdkerrors.ErrJSONMarshal, "failed to marshal Packet: %v", err) } - // TODO remove feekeeper module - // k.feeKeeper.DistributeTimeoutFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence)) - _, err = k.sudoKeeper.Sudo(ctx, icaOwner.GetContract(), msg) if err != nil { k.Logger(ctx).Debug("HandleTimeout: failed to Sudo contract on packet timeout", "error", err) diff --git a/x/interchaintxs/keeper/msg_server.go b/x/interchaintxs/keeper/msg_server.go index 9c109cb8..4e57d0f1 100644 --- a/x/interchaintxs/keeper/msg_server.go +++ b/x/interchaintxs/keeper/msg_server.go @@ -138,20 +138,6 @@ func (k Keeper) SubmitTx(goCtx context.Context, msg *ictxtypes.MsgSubmitTx) (*ic Memo: msg.Memo, } - // TODO remove feekeeper module - // sequence, found := k.channelKeeper.GetNextSequenceSend(ctx, portID, channelID) - // if !found { - // return nil, errors.Wrapf( - // channeltypes.ErrSequenceSendNotFound, - // "source port: %s, source channel: %s", portID, channelID, - // ) - // } - - // TODO remove feekeeper module - // if err := k.feeKeeper.LockFees(ctx, senderAddr, feetypes.NewPacketID(portID, channelID, sequence), msg.Fee); err != nil { - // return nil, errors.Wrapf(err, "failed to lock fees to pay for SubmitTx msg: %s", msg) - // } - resp, err := k.icaControllerMsgServer.SendTx(ctx, &icacontrollertypes.MsgSendTx{ Owner: icaOwner, ConnectionId: msg.ConnectionId, diff --git a/x/interchaintxs/types/tx.go b/x/interchaintxs/types/tx.go index 64f92e04..8549571a 100644 --- a/x/interchaintxs/types/tx.go +++ b/x/interchaintxs/types/tx.go @@ -60,11 +60,6 @@ func (msg *MsgRegisterInterchainAccount) GetSignBytes() []byte { //---------------------------------------------------------------- func (msg *MsgSubmitTx) Validate() error { - // TODO remove feerefunder module - // if err := msg.Fee.Validate(); err != nil { - // return err - // } - if len(msg.ConnectionId) == 0 { return ErrEmptyConnectionID } diff --git a/x/transfer/ibc_handlers.go b/x/transfer/ibc_handlers.go index 282657da..b36f8340 100644 --- a/x/transfer/ibc_handlers.go +++ b/x/transfer/ibc_handlers.go @@ -30,9 +30,6 @@ func (im IBCModule) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.P return nil } - // TODO remove feekeeper module - // im.wrappedKeeper.FeeKeeper.DistributeAcknowledgementFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence)) - msg, err := keeper.PrepareSudoCallbackMessage(packet, &ack) if err != nil { return errors.Wrapf(sdkerrors.ErrJSONMarshal, "failed to marshal Packet/Acknowledgment: %v", err) @@ -68,9 +65,6 @@ func (im IBCModule) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, r return errors.Wrapf(sdkerrors.ErrJSONMarshal, "failed to marshal Packet: %v", err) } - // TODO remove feekeeper module - // im.wrappedKeeper.FeeKeeper.DistributeTimeoutFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence)) - _, err = im.sudoKeeper.Sudo(ctx, senderAddress, msg) if err != nil { im.keeper.Logger(ctx).Debug("HandleAcknowledgement: failed to Sudo contract on packet timeout", "error", err) diff --git a/x/transfer/keeper/keeper.go b/x/transfer/keeper/keeper.go index aa8066ec..5fd8ee1f 100644 --- a/x/transfer/keeper/keeper.go +++ b/x/transfer/keeper/keeper.go @@ -50,15 +50,6 @@ func (k KeeperTransferWrapper) Transfer(goCtx context.Context, msg *wrappedtypes ) } - // TODO remove feekeeper module - // if the sender is a contract, lock fees. - // Because contracts are required to pay fees for the acknowledgements - // if isContract { - // if err := k.FeeKeeper.LockFees(ctx, senderAddr, feetypes.NewPacketID(msg.SourcePort, msg.SourceChannel, sequence), msg.Fee); err != nil { - // return nil, errors.Wrapf(err, "failed to lock fees to pay for transfer msg: %v", msg) - // } - // } - transferMsg := types.NewMsgTransfer(msg.SourcePort, msg.SourceChannel, msg.Token, msg.Sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, msg.Memo) if _, err := k.Keeper.Transfer(goCtx, transferMsg); err != nil { return nil, err diff --git a/x/transfer/types/tx.go b/x/transfer/types/tx.go index cc84e747..a1734741 100644 --- a/x/transfer/types/tx.go +++ b/x/transfer/types/tx.go @@ -12,13 +12,6 @@ import ( ) func (msg *MsgTransfer) Validate(isContract bool) error { - // TODO remove feerefunder module - // if isContract { - // if err := msg.Fee.Validate(); err != nil { - // return err - // } - // } - sdkMsg := types.NewMsgTransfer(msg.SourcePort, msg.SourceChannel, msg.Token, msg.Sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, msg.Memo) return sdkMsg.ValidateBasic() }