diff --git a/fluffy/tests/portal_spec_tests/mainnet/test_portal_wire_encoding.nim b/fluffy/tests/portal_spec_tests/mainnet/test_portal_wire_encoding.nim index ea60610de..6e006f9c5 100644 --- a/fluffy/tests/portal_spec_tests/mainnet/test_portal_wire_encoding.nim +++ b/fluffy/tests/portal_spec_tests/mainnet/test_portal_wire_encoding.nim @@ -1,5 +1,5 @@ -# Nimbus - Portal Network -# Copyright (c) 2021 Status Research & Development GmbH +# Fluffy +# Copyright (c) 2021-2023 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -189,6 +189,21 @@ suite "Portal Wire Protocol Message Encodings": message.content.enrs[0] == ByteList(e1.raw) message.content.enrs[1] == ByteList(e2.raw) + test "Content Response - empty enrs": + let + enrs = List[ByteList, 32].init(@[]) + c = ContentMessage(contentMessageType: enrsType, enrs: enrs) + let encoded = encodeMessage(c) + check encoded.toHex == "0502" + + let decoded = decodeMessage(encoded) + check decoded.isOk() + let message = decoded.get() + check: + message.kind == MessageKind.content + message.content.contentMessageType == enrsType + message.content.enrs.len() == 0 + test "Offer Request": let contentKeys = ContentKeysList(List(@[ByteList(@[byte 0x01, 0x02, 0x03])])) diff --git a/vendor/nim-ssz-serialization b/vendor/nim-ssz-serialization index edf07d4f7..f87c99be0 160000 --- a/vendor/nim-ssz-serialization +++ b/vendor/nim-ssz-serialization @@ -1 +1 @@ -Subproject commit edf07d4f7e0cb27afd207aa183c23cf448082d1b +Subproject commit f87c99be04f3051fe2d9b4facf5e6e71251e8555