From c7dab51192adf723e5281c8f0f52e5241f2108fc Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 29 Jul 2020 06:46:44 -0400 Subject: [PATCH] remove ack length limit (#6874) Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- x/ibc/04-channel/types/msgs.go | 3 --- x/ibc/04-channel/types/msgs_test.go | 4 ---- 2 files changed, 7 deletions(-) diff --git a/x/ibc/04-channel/types/msgs.go b/x/ibc/04-channel/types/msgs.go index e5549af1a..0b8a2065f 100644 --- a/x/ibc/04-channel/types/msgs.go +++ b/x/ibc/04-channel/types/msgs.go @@ -464,9 +464,6 @@ func (msg MsgAcknowledgement) ValidateBasic() error { if len(msg.Proof) == 0 { return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof") } - if len(msg.Acknowledgement) > 100 { - return sdkerrors.Wrap(ErrAcknowledgementTooLong, "acknowledgement cannot exceed 100 bytes") - } if msg.ProofHeight == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "proof height must be > 0") } diff --git a/x/ibc/04-channel/types/msgs_test.go b/x/ibc/04-channel/types/msgs_test.go index ea42003a2..341df4562 100644 --- a/x/ibc/04-channel/types/msgs_test.go +++ b/x/ibc/04-channel/types/msgs_test.go @@ -41,11 +41,9 @@ var ( disabledTimeout = uint64(0) validPacketData = []byte("testdata") unknownPacketData = []byte("unknown") - invalidAckData = []byte("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890") packet = types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) unknownPacket = types.NewPacket(unknownPacketData, 0, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) - invalidAck = invalidAckData emptyProof = []byte{} invalidProofs1 = commitmentexported.Proof(nil) @@ -471,7 +469,6 @@ func (suite *MsgTestSuite) TestMsgAcknowledgement() { types.NewMsgAcknowledgement(packet, packet.GetData(), suite.proof, 1, emptyAddr), types.NewMsgAcknowledgement(packet, packet.GetData(), emptyProof, 1, addr), types.NewMsgAcknowledgement(unknownPacket, packet.GetData(), suite.proof, 1, addr), - types.NewMsgAcknowledgement(packet, invalidAck, suite.proof, 1, addr), } testCases := []struct { @@ -484,7 +481,6 @@ func (suite *MsgTestSuite) TestMsgAcknowledgement() { {testMsgs[2], false, "missing signer address"}, {testMsgs[3], false, "cannot submit an empty proof"}, {testMsgs[4], false, "invalid packet"}, - {testMsgs[5], false, "invalid acknowledgement"}, } for i, tc := range testCases {