diff --git a/testing/mock/ibc_module.go b/testing/mock/ibc_module.go index ec03110e164..1cbbfe47fa7 100644 --- a/testing/mock/ibc_module.go +++ b/testing/mock/ibc_module.go @@ -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 diff --git a/testing/mock/mock.go b/testing/mock/mock.go index ca6e9c49eee..20c2641512c 100644 --- a/testing/mock/mock.go +++ b/testing/mock/mock.go @@ -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{}