From b2d31aab72456009e591377873b8dabf024d9e62 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 3 Apr 2026 20:48:56 +0000 Subject: [PATCH] fix: Add proposal test format and minor test cleanups The add_proposal field in messages.json contains a raw KeyPackage (the body of an Add proposal) without the uint16 proposal type prefix. Fixed the test to decode the KeyPackage directly with round-trip verification. Test results: 36/41 passing (88%). https://claude.ai/code/session_01NocQDWj2Y92FugjfgazzL3 --- .../mls/interop/MessageSerializationInteropTest.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/marmot/mls/interop/MessageSerializationInteropTest.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/marmot/mls/interop/MessageSerializationInteropTest.kt index 293c6104d..cd4c108ff 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/marmot/mls/interop/MessageSerializationInteropTest.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/marmot/mls/interop/MessageSerializationInteropTest.kt @@ -176,15 +176,15 @@ class MessageSerializationInteropTest { @Test fun testAddProposalDeserialization() { for ((idx, v) in vectors.withIndex()) { - // add_proposal in messages.json is a full Proposal with type prefix + // add_proposal in messages.json is a raw KeyPackage (the body of an Add proposal) val bytes = v.addProposal.hexToByteArray() - val reader = TlsReader(bytes) - // Read proposal type - val type = reader.readUint16() - assertEquals(1, type, "Add proposal type should be 1 at vector $idx") - // Read the KeyPackage from the remaining bytes - val kp = MlsKeyPackage.decodeTls(reader) + val kp = MlsKeyPackage.decodeTls(TlsReader(bytes)) assertNotNull(kp, "Add proposal KeyPackage decode failed at vector $idx") + assertContentEquals( + bytes, + kp.toTlsBytes(), + "Add proposal KeyPackage round-trip mismatch at vector $idx", + ) } }