diff --git a/modules/core/04-channel/keeper/packet_test.go b/modules/core/04-channel/keeper/packet_test.go index 7f17144be0a..3746bd2352b 100644 --- a/modules/core/04-channel/keeper/packet_test.go +++ b/modules/core/04-channel/keeper/packet_test.go @@ -551,7 +551,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() { func() { suite.coordinator.Setup(path) packet = types.NewPacket(ibctesting.MockPacketData, 1, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, timeoutHeight, disabledTimeoutTimestamp) - ack = types.NewResultAcknowledgement(nil) + ack = ibcmock.NewMockEmptyAcknowledgement() channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) }, false, diff --git a/testing/mock/ack.go b/testing/mock/ack.go new file mode 100644 index 00000000000..c25176a02da --- /dev/null +++ b/testing/mock/ack.go @@ -0,0 +1,23 @@ +package mock + +// MockEmptyAcknowledgement implements the exported.Acknowledgement interface and always returns an empty byte string as Response +type MockEmptyAcknowledgement struct { + Response []byte +} + +// NewMockEmptyAcknowledgement returns a new instance of MockEmptyAcknowledgement +func NewMockEmptyAcknowledgement() MockEmptyAcknowledgement { + return MockEmptyAcknowledgement{ + Response: []byte{}, + } +} + +// Success implements the Acknowledgement interface +func (ack MockEmptyAcknowledgement) Success() bool { + return true +} + +// Acknowledgement implements the Acknowledgement interface +func (ack MockEmptyAcknowledgement) Acknowledgement() []byte { + return []byte{} +}