remove ack length limit (#6874)
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
8b77cb442f
commit
c7dab51192
|
@ -464,9 +464,6 @@ func (msg MsgAcknowledgement) ValidateBasic() error {
|
||||||
if len(msg.Proof) == 0 {
|
if len(msg.Proof) == 0 {
|
||||||
return sdkerrors.Wrap(commitmenttypes.ErrInvalidProof, "cannot submit an empty proof")
|
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 {
|
if msg.ProofHeight == 0 {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "proof height must be > 0")
|
return sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "proof height must be > 0")
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,9 @@ var (
|
||||||
disabledTimeout = uint64(0)
|
disabledTimeout = uint64(0)
|
||||||
validPacketData = []byte("testdata")
|
validPacketData = []byte("testdata")
|
||||||
unknownPacketData = []byte("unknown")
|
unknownPacketData = []byte("unknown")
|
||||||
invalidAckData = []byte("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890")
|
|
||||||
|
|
||||||
packet = types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
|
packet = types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
|
||||||
unknownPacket = types.NewPacket(unknownPacketData, 0, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
|
unknownPacket = types.NewPacket(unknownPacketData, 0, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
|
||||||
invalidAck = invalidAckData
|
|
||||||
|
|
||||||
emptyProof = []byte{}
|
emptyProof = []byte{}
|
||||||
invalidProofs1 = commitmentexported.Proof(nil)
|
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(), suite.proof, 1, emptyAddr),
|
||||||
types.NewMsgAcknowledgement(packet, packet.GetData(), emptyProof, 1, addr),
|
types.NewMsgAcknowledgement(packet, packet.GetData(), emptyProof, 1, addr),
|
||||||
types.NewMsgAcknowledgement(unknownPacket, packet.GetData(), suite.proof, 1, addr),
|
types.NewMsgAcknowledgement(unknownPacket, packet.GetData(), suite.proof, 1, addr),
|
||||||
types.NewMsgAcknowledgement(packet, invalidAck, suite.proof, 1, addr),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
@ -484,7 +481,6 @@ func (suite *MsgTestSuite) TestMsgAcknowledgement() {
|
||||||
{testMsgs[2], false, "missing signer address"},
|
{testMsgs[2], false, "missing signer address"},
|
||||||
{testMsgs[3], false, "cannot submit an empty proof"},
|
{testMsgs[3], false, "cannot submit an empty proof"},
|
||||||
{testMsgs[4], false, "invalid packet"},
|
{testMsgs[4], false, "invalid packet"},
|
||||||
{testMsgs[5], false, "invalid acknowledgement"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tc := range testCases {
|
for i, tc := range testCases {
|
||||||
|
|
Loading…
Reference in New Issue