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

Don't return an error from OnChanUpgradeOpen #3899

Merged
merged 2 commits into from
Jun 19, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou
}

// OnChanUpgradeOpen implements the IBCModule interface
func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) error {
return errorsmod.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain")
}
func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeRestore implements the IBCModule interface
func (im IBCMiddleware) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) error {
Expand Down
4 changes: 1 addition & 3 deletions modules/apps/27-interchain-accounts/host/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ func (im IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counter
}

// OnChanUpgradeOpen implements the IBCModule interface
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) error {
return nil
}
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeRestore implements the IBCModule interface
func (im IBCModule) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) error {
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/29-fee/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou
}

// OnChanUpgradeOpen implements the IBCModule interface
func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) error {
return im.app.OnChanUpgradeOpen(ctx, portID, channelID)
func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) {
im.app.OnChanUpgradeOpen(ctx, portID, channelID)
}

// OnChanUpgradeRestore implements the IBCModule interface
Expand Down
4 changes: 1 addition & 3 deletions modules/apps/transfer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@ func (im IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counter
}

// OnChanUpgradeOpen implements the IBCModule interface
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) error {
return nil
}
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeRestore implements the IBCModule interface
func (im IBCModule) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) error {
Expand Down
2 changes: 1 addition & 1 deletion modules/core/05-port/types/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ type UpgradableModule interface {
ctx sdk.Context,
portID,
channelID string,
) error
)

// OnChanUpgradeRestore TODO
OnChanUpgradeRestore(
Expand Down
2 changes: 1 addition & 1 deletion testing/mock/ibc_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type IBCApp struct {
ctx sdk.Context,
portID,
channelID string,
) error
)

OnChanUpgradeRestore func(
ctx sdk.Context,
Expand Down
6 changes: 2 additions & 4 deletions testing/mock/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,10 @@ func (im IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counter
}

// OnChanUpgradeOpen implements the IBCModule interface
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) error {
func (im IBCModule) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string) {
if im.IBCApp.OnChanUpgradeOpen != nil {
return im.IBCApp.OnChanUpgradeOpen(ctx, portID, channelID)
im.IBCApp.OnChanUpgradeOpen(ctx, portID, channelID)
}

return nil
}

// OnChanUpgradeRestore implements the IBCModule interface
Expand Down