[go: up one dir, main page]

`Octez-codec`: Add command to dump Kaitai spec file

Context

Follows !9722 (merged) . For general context see.

This MR adds ./octez-codec dump Kaitai Struct specification for [encoding id] command. Internally this command translates from a valid Data_encoding.t to a valid Kaitai struct specification file using lib-kaitai-of-data-encoding library. Finally we dump the specification file to standard output.

For now, we only support dumping ground.uint8, since we directly depend on the support inside lib-kaitai-of-data-encoding. Later on as lib-kaitai-of-data-encoding is extended, the support is expected to be propagated to codec automatically.

Manually testing the MR

$ dune exec -- src/bin_codec/codec.exe dump Kaitai Struct specification for ground.uint8
meta:
  id: ground_uint8
seq:
- id: uint8
  type: u1

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