Skip to content

Commit

Permalink
import custom pfm into app.go
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed May 21, 2024
1 parent fca383d commit 5065d61
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import (
ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client"
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
custompfm "github.com/notional-labs/composable/v6/custom/custompfm/keeper"
customibctransfer "github.com/notional-labs/composable/v6/custom/ibc-transfer"
customstaking "github.com/notional-labs/composable/v6/custom/staking"
"github.com/spf13/cast"
Expand Down Expand Up @@ -339,6 +340,7 @@ func NewComposableApp(
enabledProposals,
)

custompfm.NewIBCMiddleware()

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / build

not enough arguments in call to custompfm.NewIBCMiddleware

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / Analyze

not enough arguments in call to custompfm.NewIBCMiddleware

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to custompfm.NewIBCMiddleware

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to custompfm.NewIBCMiddleware

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to custompfm.NewIBCMiddleware

Check failure on line 343 in app/app.go

View workflow job for this annotation

GitHub Actions / test

not enough arguments in call to custompfm.NewIBCMiddleware
// transferModule := transfer.NewAppModule(app.TransferKeeper)
transferModule := customibctransfer.NewAppModule(appCodec, app.TransferKeeper, app.BankKeeper)
routerModule := router.NewAppModule(app.RouterKeeper)
Expand Down
40 changes: 40 additions & 0 deletions custom/custompfm/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package keeper

import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
router "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var _ porttypes.Middleware = &IBCMiddleware{}

// IBCMiddleware implements the ICS26 callbacks for the forward middleware given the
// forward keeper and the underlying application.
type IBCMiddleware struct {
router.IBCMiddleware
}

func NewIBCMiddleware(
app porttypes.IBCModule,
k *keeper.Keeper,
retriesOnTimeout uint8,
forwardTimeout time.Duration,
refundTimeout time.Duration,
) IBCMiddleware {
return IBCMiddleware{
IBCMiddleware: router.NewIBCMiddleware(app, k, retriesOnTimeout, forwardTimeout, refundTimeout),
}
}

func (im IBCMiddleware) OnRecvPacket(
ctx sdk.Context,
packet channeltypes.Packet,
relayer sdk.AccAddress,
) ibcexported.Acknowledgement {
return im.IBCMiddleware.OnRecvPacket(ctx, packet, relayer)
}

0 comments on commit 5065d61

Please sign in to comment.