Skip to content

Commit

Permalink
wrap transfer stack with HooksICS4Wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed Jul 12, 2023
1 parent f4d99f4 commit 8bd3a0c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,18 +526,6 @@ func NewMigalooApp(
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(alliancemoduletypes.RouterKey, alliancemodule.NewAllianceProposalHandler(app.AllianceKeeper))

// RouterKeeper must be created before TransferKeeper
app.RouterKeeper = *routerkeeper.NewKeeper(
appCodec,
app.keys[routertypes.StoreKey],
app.GetSubspace(routertypes.ModuleName),
app.TransferKeeper,
app.IBCKeeper.ChannelKeeper,
app.DistrKeeper,
app.BankKeeper,
app.IBCKeeper.ChannelKeeper,
)

// Configure the hooks keeper
hooksKeeper := ibchookskeeper.NewKeeper(
app.keys[ibchookstypes.StoreKey],
Expand Down Expand Up @@ -573,6 +561,18 @@ func NewMigalooApp(
scopedTransferKeeper,
)

// RouterKeeper must be created before TransferKeeper
app.RouterKeeper = *routerkeeper.NewKeeper(
appCodec,
app.keys[routertypes.StoreKey],
app.GetSubspace(routertypes.ModuleName),
app.TransferKeeper,
app.IBCKeeper.ChannelKeeper,
app.DistrKeeper,
app.BankKeeper,
app.HooksICS4Wrapper,
)

// ICA Host keeper
app.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName),
Expand Down Expand Up @@ -685,14 +685,14 @@ func NewMigalooApp(
var transferStack ibcporttypes.IBCModule
transferStack = transfer.NewIBCModule(app.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper)
transferStack = ibchooks.NewIBCMiddleware(transferStack, &app.HooksICS4Wrapper)
transferStack = router.NewIBCMiddleware(
transferStack,
&app.RouterKeeper,
0,
routerkeeper.DefaultForwardTransferPacketTimeoutTimestamp,
routerkeeper.DefaultRefundTransferPacketTimeoutTimestamp,
)
transferStack = ibchooks.NewIBCMiddleware(transferStack, &app.HooksICS4Wrapper)

// Create Interchain Accounts Stack
// SendPacket, since it is originating from the application to core IBC:
Expand Down

0 comments on commit 8bd3a0c

Please sign in to comment.