Skip to content

Commit a0d2c69

Browse files
mrmr1993pstecklermergify[bot]
authored
Bump snarky (#4335)
* Bump snarky * update test for new snarkette serialization * use %%versioned_asserted * remove redundant items from deriving list Co-authored-by: psteckler <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 3103c23 commit a0d2c69

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

src/lib/lite_base/public_key.ml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,19 @@ module Field = Crypto_params.Tock.Fq
1111
type t = Crypto_params.Tock.G1.t
1212

1313
module Compressed = struct
14+
[%%versioned_asserted
1415
module Stable = struct
1516
module V1 = struct
16-
module T = struct
17-
type t = {x: Field.t; is_odd: bool}
18-
[@@deriving bin_io, eq, sexp, version {asserted}]
17+
type t = {x: Field.t; is_odd: bool} [@@deriving eq, sexp]
1918

20-
module Display = struct
21-
type t = {x: string; is_odd: bool} [@@deriving to_yojson]
22-
end
19+
let to_latest = Fn.id
2320

24-
let to_yojson {x; is_odd} =
25-
Display.to_yojson {Display.x= Field.to_string x; is_odd}
21+
module Display = struct
22+
type t = {x: string; is_odd: bool} [@@deriving to_yojson]
2623
end
2724

28-
include T
29-
include Registration.Make_latest_version (T)
25+
let to_yojson {x; is_odd} =
26+
Display.to_yojson {Display.x= Field.to_string x; is_odd}
3027

3128
let gen =
3229
let open Quickcheck.Let_syntax in
@@ -35,19 +32,7 @@ module Compressed = struct
3532
{x; is_odd}
3633
end
3734

38-
module Latest = V1
39-
40-
module Module_decl = struct
41-
let name = "public_key"
42-
43-
type latest = Latest.t
44-
end
45-
46-
module Registrar = Registration.Make (Module_decl)
47-
module Registered_V1 = Registrar.Register (V1)
48-
49-
(* see lib/module_version/README-version-asserted.md *)
50-
module For_tests = struct
35+
module Tests = struct
5136
[%%if
5237
curve_size = 298]
5338

@@ -56,7 +41,7 @@ module Compressed = struct
5641
Quickcheck.random_value ~seed:(`Deterministic "public key") V1.gen
5742
in
5843
let known_good_hash =
59-
"\x7F\x07\x2A\x75\x70\x5C\x9A\x00\x44\x7C\x26\x3B\xC7\x05\xCF\x83\x8D\x2F\x9D\xB6\x2E\x4B\xE7\x64\x8B\x33\xF4\xC8\x08\x56\x1F\x86"
44+
"\x20\x1E\xC9\xEC\x67\x5E\x76\x79\x18\xBB\x28\x2C\x51\x5B\x36\x37\x5B\x5F\x39\x18\x21\x3A\x33\x4C\x69\x4B\x8C\xC6\x09\x24\xAD\xE7"
6045
in
6146
Serialization.check_serialization (module V1) pk known_good_hash
6247

@@ -68,7 +53,7 @@ module Compressed = struct
6853
Quickcheck.random_value ~seed:(`Deterministic "public key") V1.gen
6954
in
7055
let known_good_hash =
71-
"\x45\x3D\x4F\x3B\xE7\x79\x9C\xFD\x18\xFB\x49\x58\xD6\x62\xF7\xCB\xA1\xA6\xEA\x56\x24\x66\x29\x9B\xCE\xF7\x07\x26\x10\xAA\x5B\xB5"
56+
"\xBE\x4C\x9B\xAC\xD4\xEA\x2A\x78\xCF\xC6\x70\x70\x8E\xB0\x31\xCA\x6B\x09\xB2\xD5\x28\xB3\x19\xCA\x18\xC8\x4E\x4A\xA2\xCC\xCB\xDF"
7257
in
7358
Serialization.check_serialization (module V1) pk known_good_hash
7459

@@ -78,7 +63,7 @@ module Compressed = struct
7863

7964
[%%endif]
8065
end
81-
end
66+
end]
8267

8368
type t = Stable.Latest.t = {x: Field.t; is_odd: bool} [@@deriving eq, sexp]
8469

0 commit comments

Comments
 (0)