From e33eac6a6f655c4c6881c879decfe5baea3b0b38 Mon Sep 17 00:00:00 2001 From: swrup Date: Tue, 7 Oct 2025 17:28:14 +0200 Subject: [PATCH] --- a.output | Bin 0 -> 76 bytes b.output | 0 src/binary_formats.ml | 24 ++++++++++++++++-------- test/test.ml | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 a.output create mode 100644 b.output diff --git a/a.output b/a.output new file mode 100644 index 0000000000000000000000000000000000000000..53eb1eba6bd76a2ede16edea6546a89a6798d61b GIT binary patch literal 76 zcmeZaU|^79VPIfnVrF4wW9Q)H;^yJy;};MV5*85^6PJ*bl9rK`lUGnwQdUt_Q`gYc f($>+{(>E|QGBz - { h_planchets; noreveal_index }) - |+ field Purpose.bin (Fun.const purpose) - |+ field HashPlanchetsP.bin (fun t -> t.h_planchets) - |+ field beint32 (fun t -> t.noreveal_index) + record (fun purpose h_planchets noreveal_index -> + (purpose, { h_planchets; noreveal_index })) + |+ field Purpose.bin (fun (purpose, _t) -> purpose) + |+ field HashPlanchetsP.bin (fun (_p, t) -> t.h_planchets) + |+ field beint32 (fun (_p, t) -> t.noreveal_index) |> sealr + + let size = + match Size.of_value (Size.size_of bin) with + | Dynamic _ | Unknown -> Fmt.failwith "size_of failure: size is not Static" + | Static n -> n + + let purpose = Purpose.make ~size Taler_signatures.exchange_confirm_withdraw + let bin = map bin (fun (_p, t) -> t) (fun t -> (purpose, t)) end diff --git a/test/test.ml b/test/test.ml index 5629d120..8f233513 100644 --- a/test/test.ml +++ b/test/test.ml @@ -80,8 +80,8 @@ let () = assert (size = size'); assert (size = 76); - (* for cmp test with signatures.c output + (* for cmp test with signatures.c output *) let raw_str = Bin.to_string bin dummy_t in Printf.printf "%s" raw_str; - *) + ()