Skip to content

Commit

Permalink
imp: upstream mock app error type included in 7c5384f (#4189)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
  • Loading branch information
3 people authored Jul 28, 2023
1 parent 0bce6b5 commit 38d3122
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions testing/mock/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import (
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

// applicationCallbackError is a custom error type that will be unique for testing purposes.
type applicationCallbackError struct{}

func (e applicationCallbackError) Error() string {
return "mock application callback failed"
}

// IBCModule implements the ICS26 callbacks for testing/mock.
type IBCModule struct {
appModule *AppModule
Expand Down
3 changes: 3 additions & 0 deletions testing/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var (
MockRecvCanaryCapabilityName = "mock receive canary capability name"
MockAckCanaryCapabilityName = "mock acknowledgement canary capability name"
MockTimeoutCanaryCapabilityName = "mock timeout canary capability name"
// MockApplicationCallbackError should be returned when an application callback should fail. It is possible to
// test that this error was returned using ErrorIs.
MockApplicationCallbackError error = &applicationCallbackError{}
)

var _ porttypes.IBCModule = IBCModule{}
Expand Down

0 comments on commit 38d3122

Please sign in to comment.