Skip to content

Merge compatible to develop (20 May 2025) #17226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c614ab9
Submodules/crypto: bump up proof-systems
dannywillems May 6, 2025
05e3d57
Rust: use 1.81.0 and nightly-2024-09-05
dannywillems May 6, 2025
4f86cfc
Dockerfile: wasm-pack is now a dependencies in proof-systems
dannywillems May 6, 2025
9b8f16c
Dockerfile: remove installation of wasm-pack
dannywillems May 6, 2025
b7b6572
Dockerfile: install cargo-xtask
dannywillems May 6, 2025
ca91b4b
Dockerfile: wrap long lines at 80 chars
dannywillems May 6, 2025
a82c2d5
Buildkite: bump up toolchain images
dannywillems May 6, 2025
6854f5c
Bump up proof-systems
dannywillems May 12, 2025
81b7f46
Move deprecated value out of schnorr
cjjdespres May 12, 2025
613d7d4
Merge branch 'compatible' into dw/bump-up-to-rust-1.81
dannywillems May 13, 2025
fd1477d
Merge pull request #17171 from MinaProtocol/compiled-signature-kind-s…
georgeee May 13, 2025
7c656f8
Move deprecated value out of account update
cjjdespres May 13, 2025
ea1ed82
Merge pull request #17187 from MinaProtocol/compiled-signature-kind-a…
dannywillems May 14, 2025
6e3b5ff
Merge pull request #17156 from MinaProtocol/dw/bump-up-to-rust-1.81
dannywillems May 15, 2025
a1ab503
Snark Work Lib: order dune dependencies alphabetically
glyh May 15, 2025
80eb694
Merge pull request #17193 from MinaProtocol/corvo/dummy-1
dannywillems May 15, 2025
5970574
Mina Stdlib: Add Time.Span -- yojsonable, sexpable time span
glyh May 16, 2025
47837de
UNCOMPIABLE Ledger Proof: lift Prod to top level so there's only one …
glyh May 16, 2025
545a67e
Propagate change of Ledger Proof API around the codebase
glyh May 16, 2025
01cf031
Ledger Proof: remove function {sok_digest, Cached.sok_digest}, unused
glyh May 16, 2025
3b81567
Snarked Ledger State: implement Full.Poly.drop_sok
glyh May 16, 2025
e193bdf
Snark Work Lib: factor out Result_without_metrics
glyh May 16, 2025
4d1096a
Snark Work Lib: add interface for Result_without_metrics
glyh May 16, 2025
f1257d5
Add tests for Time.Span.V1 json
georgeee May 16, 2025
053c146
Merge pull request #17201 from MinaProtocol/corvo/snark-work-libmove-…
glyh May 16, 2025
0c3cf11
Merge pull request #17200 from MinaProtocol/corvo/snarked-ledger-stat…
glyh May 16, 2025
7392381
Merge pull request #17196 from MinaProtocol/corvo/remove-ledger-proof…
glyh May 16, 2025
bd0d537
Snark Worker: collect all structured log events in a new module
glyh May 16, 2025
1c3376c
Merge pull request #17195 from MinaProtocol/corvo/mina-stdlib-time
glyh May 16, 2025
d256b17
Snark Work Lib: track single spec(Poly/Selector) in a self contained …
glyh May 16, 2025
090a601
Snark Work Lib: write a notice on these file would be removed finally
glyh May 16, 2025
5bc0ef7
Snark Work Lib: create interface for Single Spec
glyh May 16, 2025
3a5b776
Work Partitioner: set up library
glyh May 16, 2025
0546f65
Merge pull request #17198 from MinaProtocol/corvo/ledger-proof-drop-s…
glyh May 16, 2025
0861531
Merge pull request #17203 from MinaProtocol/corvo/snark-worker-collec…
glyh May 16, 2025
1c25814
Merge pull request #17205 from MinaProtocol/corvo/setup-work-partitioner
glyh May 16, 2025
4cad6b7
Merge pull request #17204 from MinaProtocol/corvo/snark-work-lib-sing…
glyh May 16, 2025
afb7131
pickles/gen_scalars: remove dead code
marcbeunardeau88 May 6, 2025
6284b4c
pickles/gen_scalars: remove empty index_terms
marcbeunardeau88 May 6, 2025
e35861c
Makefile: add a target for `cargo vendor kimchi-stubs-vendors`
anne-laure-s May 16, 2025
1dbc934
Merge pull request #17159 from MinaProtocol/marc/pickles-remove-dead-…
marcbeunardeau88 May 16, 2025
63e5b7b
Merge pull request #17208 from MinaProtocol/al/makefile
dannywillems May 16, 2025
af790c8
Merge branch 'dkijania/once_again_fix_rosetta' into dkijania/port_ros…
dkijania May 19, 2025
b8da255
revert mesh -> rosetta
dkijania May 16, 2025
8535670
Merge pull request #17219 from MinaProtocol/dkijania/port_rosetta_fix…
dkijania May 19, 2025
b4dd834
Merge remote-tracking branch 'origin/compatible' into HEAD
georgeee May 20, 2025
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
Prev Previous commit
Next Next commit
Add tests for Time.Span.V1 json
  • Loading branch information
georgeee committed May 16, 2025
commit f1257d527502b7827eb8ae7b5365ac56f352251f
18 changes: 18 additions & 0 deletions src/lib/mina_stdlib/tests/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(test
(name main)
(libraries
;; opam libraries
core_kernel
async_kernel
async_unix
base
sexplib0
yojson
alcotest
;; local libraries
mina_stdlib
ppx_version.runtime)
(preprocess
(pps ppx_jane ppx_version ppx_deriving.std ppx_base ppx_let ppx_assert))
(instrumentation
(backend bisect_ppx)))
34 changes: 34 additions & 0 deletions src/lib/mina_stdlib/tests/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(** Testing
-------
Component: Mina stdlib
Invocation: dune exec src/lib/mina_stdlib/tests/main.exe
Subject: Main test runner for mina_stdlib tests
*)

(* Run all tests *)
let () =
let open Alcotest in
run "Time.Span.Stable.V1 JSON roundtrip"
[ ( "basic roundtrip tests"
, [ test_case "basic json roundtrip" `Quick
Time_test.test_basic_json_roundtrip
; test_case "zero span roundtrip" `Quick
Time_test.test_zero_span_roundtrip
; test_case "positive span roundtrip" `Quick
Time_test.test_positive_span_roundtrip
; test_case "negative span roundtrip" `Quick
Time_test.test_negative_span_roundtrip
; test_case "fraction span roundtrip" `Quick
Time_test.test_fraction_span_roundtrip
; test_case "very small span roundtrip" `Quick
Time_test.test_very_small_span_roundtrip
; test_case "large span roundtrip" `Quick
Time_test.test_large_span_roundtrip
] )
; ( "error cases"
, [ test_case "invalid json input" `Quick
Time_test.test_invalid_json_input
; test_case "non-float json type" `Quick
Time_test.test_non_float_json_type
] )
]
117 changes: 117 additions & 0 deletions src/lib/mina_stdlib/tests/time_test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
open Core_kernel

(** Testing
-------
Component: Mina stdlib
Invocation: dune exec src/lib/mina_stdlib/tests/main.exe
Subject: Test JSON roundtrip for Time.Span.Stable.V1
*)

module SpanV1 = Mina_stdlib.Time.Span.Stable.V1

(* Test that basic JSON serialization roundtrip works *)
let test_basic_json_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 42.0 in
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Roundtrip equality" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test zero span roundtrip *)
let test_zero_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 0.0 in
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Zero span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test positive span roundtrip *)
let test_positive_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 86400.0 in
(* One day *)
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Positive span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test negative span roundtrip *)
let test_negative_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec (-3600.0) in
(* Negative one hour *)
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Negative span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test fraction span roundtrip *)
let test_fraction_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 0.001 in
(* 1 millisecond *)
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Fraction span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test very small span roundtrip *)
let test_very_small_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 1e-6 in
(* 1 microsecond *)
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Very small span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test large span roundtrip *)
let test_large_span_roundtrip () =
let span = Core_kernel.Time.Span.of_sec 31536000.0 in
(* 1 year *)
let json = SpanV1.to_yojson span in
match SpanV1.of_yojson json with
| Ok decoded ->
Alcotest.(check bool)
"Large span roundtrip" true
(Core_kernel.Time.Span.equal span decoded)
| Error msg ->
Alcotest.fail ("JSON parsing failed: " ^ msg)

(* Test invalid JSON input *)
let test_invalid_json_input () =
match SpanV1.of_yojson (`String "not a valid float") with
| Ok _ ->
Alcotest.fail "Expected error for invalid input"
| Error _ ->
(* Expected error, test passes *)
()

(* Test non-float JSON type *)
let test_non_float_json_type () =
match SpanV1.of_yojson (`Bool true) with
| Ok _ ->
Alcotest.fail "Expected error for non-float JSON type"
| Error _ ->
(* Expected error, test passes *)
()