Skip to content

Commit

Permalink
remove refundTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed May 22, 2024
1 parent e9b46e4 commit aee619e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion middleware/packet-forward-middleware/docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions middleware/packet-forward-middleware/test/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand Down Expand Up @@ -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)
}
1 change: 0 additions & 1 deletion middleware/packet-forward-middleware/testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") != "" {
Expand Down

0 comments on commit aee619e

Please sign in to comment.