From f66ee4cf0e98bb7e421fa7ba04998a061c2eb431 Mon Sep 17 00:00:00 2001 From: sampocs Date: Thu, 1 Jun 2023 16:06:00 -0500 Subject: [PATCH] used legacy SendTx function for ICAs --- x/stakeibc/keeper/msg_server_submit_tx.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 5c78dac882..87c29a72f3 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -26,8 +26,6 @@ import ( icqtypes "github.com/Stride-Labs/stride/v9/x/interchainquery/types" sdk "github.com/cosmos/cosmos-sdk/types" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" ) @@ -288,17 +286,14 @@ func (k Keeper) SubmitTxs( Data: data, } - msg := icacontrollertypes.NewMsgSendTx(owner, connectionId, timeoutTimestamp, packetData) - - msgServer := icacontrollerkeeper.NewMsgServerImpl(&k.ICAControllerKeeper) - - res, err := msgServer.SendTx(ctx, msg) + // TODO: SendTx is deprecated and MsgServer should used going forward + // IMPORTANT: When updating to MsgServer, the timestamp passed to NewMsgSendTx is the relative timeout offset, + // not the unix time (e.g. "30 minutes in nanoseconds" instead "current unix nano + 30 minutes in nanoseconds") + sequence, err := k.ICAControllerKeeper.SendTx(ctx, nil, connectionId, portID, packetData, timeoutTimestamp) // nolint:staticcheck if err != nil { return 0, err } - sequence := res.Sequence - // Store the callback data if callbackId != "" && callbackArgs != nil { callback := icacallbackstypes.CallbackData{