[go: up one dir, main page]

Kaitai-of-data-encoding: Automatically translate remaining ground types

Context

Follows !9882 (merged) . For more context see !9722 (merged) context description. But in short this MR automatically translates most of the remaining data-encoding ground types to kaitai specification:

  • numeric:
    • int8
    • int16
    • uint16
    • int32
    • int31
    • int64
    • float
  • bytes
    • size prefix other then u4 not supported, e.g. n prefixed size (#6260)
  • string
    • size prefix other then u4 not supported, e.g. n prefixed size (#6260)
  • n (big number) and its siblings - !9924 (merged)

In addition to this the MR also introduces some code quality improvements: 2b98320e

Follow-up

Manually testing the MR

Manually testing generated spec file and parsers

uint16

Expected uint16.ksy:

 meta:
   id: ground__uint16
   endian: be
 seq:
 - id: uint16
   type: u2

Generate parser from the spec file:

kaitai-struct-compiler uint16.ksy -t rust

Generate exemplary .bin:

./octez-codec encode ground.uint16 from 25445 | xxd -r -p > uint16_bin

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Martin Tomazic

Merge request reports

Loading