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 error return from OnChanUpgradeRestore. #3902

Merged
merged 2 commits into from
Jun 20, 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 @@ -244,9 +244,7 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou
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 {
return nil
}
func (im IBCMiddleware) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeTimeout implements the IBCModule interface
func (im IBCMiddleware) OnChanUpgradeTimeout(
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 @@ -168,9 +168,7 @@ func (im IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counter
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 {
return nil
}
func (im IBCModule) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeTimeout implements the IBCModule interface
func (im IBCModule) OnChanUpgradeTimeout(
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 @@ -341,8 +341,8 @@ func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID str
}

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

// OnChanUpgradeTimeout 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 @@ -320,9 +320,7 @@ func (im IBCModule) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counter
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 {
return nil
}
func (im IBCModule) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) {}

// OnChanUpgradeTimeout implements the IBCModule interface
func (im IBCModule) OnChanUpgradeTimeout(
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 @@ -148,7 +148,7 @@ type UpgradableModule interface {
ctx sdk.Context,
portID,
channelID string,
) error
)

// OnChanUpgradeTimeout times out an outstanding upgrade when the counterparty chain has not responded.
OnChanUpgradeTimeout(
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 @@ -120,7 +120,7 @@ type IBCApp struct {
ctx sdk.Context,
portID,
channelID string,
) error
)

OnChanUpgradeTimeout 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 @@ -197,12 +197,10 @@ 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 {
func (im IBCModule) OnChanUpgradeRestore(ctx sdk.Context, portID, channelID string) {
if im.IBCApp.OnChanUpgradeRestore != nil {
return im.IBCApp.OnChanUpgradeRestore(ctx, portID, channelID)
im.IBCApp.OnChanUpgradeRestore(ctx, portID, channelID)
}

return nil
}

// OnChanUpgradeTimeout implements the IBCModule interface
Expand Down