From aee619e7d533ad978379a5d27f7e79da2258e520 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 22 May 2024 00:09:46 -0500 Subject: [PATCH] remove `refundTimeout` --- middleware/packet-forward-middleware/docs/integration.md | 1 - .../packetforward/ibc_middleware.go | 3 --- .../packetforward/keeper/keeper.go | 3 --- middleware/packet-forward-middleware/test/setup.go | 6 +++--- middleware/packet-forward-middleware/testing/simapp/app.go | 1 - 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/middleware/packet-forward-middleware/docs/integration.md b/middleware/packet-forward-middleware/docs/integration.md index e27f2ba3..15903821 100644 --- a/middleware/packet-forward-middleware/docs/integration.md +++ b/middleware/packet-forward-middleware/docs/integration.md @@ -147,7 +147,6 @@ transferStack = packetforward.NewIBCMiddleware( app.PacketForwardKeeper, 0, // retries on timeout packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout - packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) // Add transfer stack to IBC Router diff --git a/middleware/packet-forward-middleware/packetforward/ibc_middleware.go b/middleware/packet-forward-middleware/packetforward/ibc_middleware.go index b54e91b2..c10f6de2 100644 --- a/middleware/packet-forward-middleware/packetforward/ibc_middleware.go +++ b/middleware/packet-forward-middleware/packetforward/ibc_middleware.go @@ -35,7 +35,6 @@ type IBCMiddleware struct { retriesOnTimeout uint8 forwardTimeout time.Duration - refundTimeout time.Duration } // NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. @@ -44,14 +43,12 @@ func NewIBCMiddleware( k *keeper.Keeper, retriesOnTimeout uint8, forwardTimeout time.Duration, - refundTimeout time.Duration, ) IBCMiddleware { return IBCMiddleware{ app: app, keeper: k, retriesOnTimeout: retriesOnTimeout, forwardTimeout: forwardTimeout, - refundTimeout: refundTimeout, } } diff --git a/middleware/packet-forward-middleware/packetforward/keeper/keeper.go b/middleware/packet-forward-middleware/packetforward/keeper/keeper.go index 16c01ec9..687e3af0 100644 --- a/middleware/packet-forward-middleware/packetforward/keeper/keeper.go +++ b/middleware/packet-forward-middleware/packetforward/keeper/keeper.go @@ -39,9 +39,6 @@ var ( // DefaultForwardTransferPacketTimeoutTimestamp is the timeout timestamp following IBC defaults DefaultForwardTransferPacketTimeoutTimestamp = time.Duration(transfertypes.DefaultRelativePacketTimeoutTimestamp) * time.Nanosecond - - // DefaultRefundTransferPacketTimeoutTimestamp is a 28-day timeout for refund packets since funds are stuck in packetforward module otherwise. - DefaultRefundTransferPacketTimeoutTimestamp = 28 * 24 * time.Hour ) // Keeper defines the packet forward middleware keeper diff --git a/middleware/packet-forward-middleware/test/setup.go b/middleware/packet-forward-middleware/test/setup.go index 9534c4cb..6c525b0e 100644 --- a/middleware/packet-forward-middleware/test/setup.go +++ b/middleware/packet-forward-middleware/test/setup.go @@ -63,7 +63,7 @@ func NewTestSetup(t *testing.T, ctl *gomock.Controller) *Setup { ICS4WrapperMock: ics4WrapperMock, }, - ForwardMiddleware: initializer.forwardMiddleware(ibcModuleMock, packetforwardKeeper, 0, keeper.DefaultForwardTransferPacketTimeoutTimestamp, keeper.DefaultRefundTransferPacketTimeoutTimestamp), + ForwardMiddleware: initializer.forwardMiddleware(ibcModuleMock, packetforwardKeeper, 0, keeper.DefaultForwardTransferPacketTimeoutTimestamp), } } @@ -158,6 +158,6 @@ func (i initializer) packetforwardKeeper( return packetforwardKeeper } -func (i initializer) forwardMiddleware(app porttypes.IBCModule, k *keeper.Keeper, retriesOnTimeout uint8, forwardTimeout time.Duration, refundTimeout time.Duration) packetforward.IBCMiddleware { - return packetforward.NewIBCMiddleware(app, k, retriesOnTimeout, forwardTimeout, refundTimeout) +func (i initializer) forwardMiddleware(app porttypes.IBCModule, k *keeper.Keeper, retriesOnTimeout uint8, forwardTimeout time.Duration) packetforward.IBCMiddleware { + return packetforward.NewIBCMiddleware(app, k, retriesOnTimeout, forwardTimeout) } diff --git a/middleware/packet-forward-middleware/testing/simapp/app.go b/middleware/packet-forward-middleware/testing/simapp/app.go index 7f4fde5c..fb584d47 100644 --- a/middleware/packet-forward-middleware/testing/simapp/app.go +++ b/middleware/packet-forward-middleware/testing/simapp/app.go @@ -542,7 +542,6 @@ func NewSimApp( app.PacketForwardKeeper, 0, // retries on timeout packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout - packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) if os.Getenv("NON_REFUNDABLE_TEST") != "" {