pub fn reassemble_from_chunks(chunks: Vec<ChunkFragment>) -> Result<Vec<u8>>Expand description
Reassemble canonical bytecode from a list of parsed chunks.
Validates SPEC §4 rules 11–13 in order:
- All chunks must be
Chunked(mixing withSingleStringis rejected). - All chunks share
chunk_set_idandtotal_chunks(Error::ChunkSetIdMismatch,Error::ChunkedHeaderMalformed). chunk_indexvalues cover0..total_chunksexactly once (Error::ChunkedHeaderMalformedon gaps, duplicates, or out-of-range).- The reassembled stream’s trailing 4-byte cross-chunk hash matches
SHA-256(reassembled_bytecode)[0..4](Error::CrossChunkHashMismatch).
Chunks may arrive in any order; this function sorts internally.