Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ICA hooks #480

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove ica hooks
  • Loading branch information
colin-axner committed Oct 8, 2021
commit 644c3c3880dd0c003bfc4e437ba863881cc9ddd6
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) {
}