Skip to content

Commit

Permalink
remove ica hooks (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner authored Oct 8, 2021
1 parent e072e67 commit 9595948
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
5 changes: 1 addition & 4 deletions modules/apps/27-interchain-accounts/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ type Keeper struct {
storeKey sdk.StoreKey
cdc codec.BinaryCodec

hook types.IBCAccountHooks

channelKeeper types.ChannelKeeper
portKeeper types.PortKeeper
accountKeeper types.AccountKeeper
Expand All @@ -37,7 +35,7 @@ type Keeper struct {
func NewKeeper(
cdc codec.BinaryCodec, key sdk.StoreKey,
channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
accountKeeper types.AccountKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter *baseapp.MsgServiceRouter, hook types.IBCAccountHooks,
accountKeeper types.AccountKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter *baseapp.MsgServiceRouter,
) Keeper {

// ensure ibc interchain accounts module account is set
Expand All @@ -53,7 +51,6 @@ func NewKeeper(
accountKeeper: accountKeeper,
scopedKeeper: scopedKeeper,
msgRouter: msgRouter,
hook: hook,
}
}

Expand Down
17 changes: 1 addition & 16 deletions modules/apps/27-interchain-accounts/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet) error
}

func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data types.InterchainAccountPacketData, ack channeltypes.Acknowledgement) error {
switch ack.Response.(type) {
case *channeltypes.Acknowledgement_Error:
if k.hook != nil {
k.hook.OnTxFailed(ctx, packet.SourcePort, packet.SourceChannel, packet.Data, data.Data)
}
return nil
case *channeltypes.Acknowledgement_Result:
if k.hook != nil {
k.hook.OnTxSucceeded(ctx, packet.SourcePort, packet.SourceChannel, packet.Data, data.Data)
}
return nil
default:
// the acknowledgement succeeded on the receiving chain so nothing
// needs to be executed and no error needs to be returned
return nil
}
return nil
}

// OnTimeoutPacket removes the active channel associated with the provided packet, the underlying channel end is closed
Expand Down
9 changes: 1 addition & 8 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func NewSimApp(
app.ICAKeeper = icakeeper.NewKeeper(
appCodec, keys[icatypes.StoreKey],
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
app.AccountKeeper, scopedICAKeeper, app.MsgServiceRouter(), app,
app.AccountKeeper, scopedICAKeeper, app.MsgServiceRouter(),
)
icaModule := ica.NewAppModule(app.ICAKeeper)
icaIBCModule := ica.NewIBCModule(app.ICAKeeper, nil)
Expand Down Expand Up @@ -682,10 +682,3 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino

return paramsKeeper
}

// Interchain Accounts code
func (*SimApp) OnTxSucceeded(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
}

func (*SimApp) OnTxFailed(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
}

0 comments on commit 9595948

Please sign in to comment.