Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion changes/17099.md

This file was deleted.

14 changes: 3 additions & 11 deletions src/lib/crypto/kimchi_pasta_snarky_backend/field.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,11 @@ module Make (F : Input_intf) :
let to_yojson t : Yojson.Safe.t =
`String (Bigint.to_hex_string (to_bigint t))

let of_yojson j =
match j with
let of_yojson = function
| `String s ->
let parsed_bigint =
if
String.is_prefix ~prefix:"0x" s
|| String.is_prefix ~prefix:"0X" s
then Bigint.of_hex_string s
else Bigint.of_decimal_string s
in
Ok (of_bigint parsed_bigint)
Ok (of_bigint (Bigint.of_hex_string s))
| _ ->
Error "Expected a hex string or a decimal string"
Error "expected hex string"
end
end]

Expand Down
4 changes: 1 addition & 3 deletions src/lib/mina_block/tests/dune
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
(test
(name main)
(libraries alcotest async core_kernel disk_cache.lmdb mina_block yojson)
(deps
hetzner-itn-1-1795.json
regtest-devnet-319281-3NKq8WXEzMFJH3VdmK4seCTpciyjSY2Rf39K7q1Yyt1p4HkqSzqA.json)
(deps hetzner-itn-1-1795.json)
(instrumentation
(backend bisect_ppx))
(preprocess
Expand Down
11 changes: 0 additions & 11 deletions src/lib/mina_block/tests/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ let json_serialization_roundtrips_from_file () =
json_serialization_roundtrips_impl
@@ In_channel.read_all large_precomputed_json_file

let field_element_decimal_deserialization () =
let filename =
"regtest-devnet-319281-3NKq8WXEzMFJH3VdmK4seCTpciyjSY2Rf39K7q1Yyt1p4HkqSzqA.json"
in
let json = Yojson.Safe.from_file filename in
json_serialization_is_stable_impl @@ Yojson.Safe.to_string json

let () =
run "Precomputed block serialization tests"
[ ( "sexp"
Expand All @@ -89,10 +82,6 @@ let () =
; test_case "serialization roundtrips from file" `Quick
json_serialization_roundtrips_from_file
] )
; ( "field element represented by decimal"
, [ test_case "block is deserializable" `Quick
field_element_decimal_deserialization
] )
; ( "memory caching"
, [ test_case "caching works" `Quick (fun () ->
Memory_caching.test large_precomputed_json_file )
Expand Down
Loading