Skip to content

Commit

Permalink
Add proof-cache for zkapp_payments test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Oct 17, 2023
1 parent 9986785 commit 57f53ca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/transaction_snark/test/zkapp_payments/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
core_kernel
yojson
sexplib0
ppx_deriving_yojson.runtime
result
;; local libraries
logger
mina_base.import
Expand All @@ -36,7 +38,7 @@
mina_transaction
)
(library_flags -linkall)
(inline_tests (flags -verbose -show-counts))
(inline_tests (flags -verbose -show-counts) (deps proof_cache.json))
(preprocess
(pps ppx_snarky ppx_version ppx_jane ppx_mina))
(instrumentation (backend bisect_ppx)))

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/lib/transaction_snark/test/zkapp_payments/zkapp_payments.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ open Mina_base

let%test_module "Zkapp payments tests" =
( module struct
let proof_cache =
Result.ok_or_failwith @@ Pickles.Proof_cache.of_yojson
@@ Yojson.Safe.from_file "proof_cache.json"

let () = Transaction_snark.For_tests.set_proof_cache proof_cache

let memo = Signed_command_memo.create_from_string_exn "Zkapp payments tests"

[@@@warning "-32"]
Expand Down Expand Up @@ -289,4 +295,11 @@ let%test_module "Zkapp payments tests" =
~expected_failure:
(Transaction_status.Failure.Overflow, Pass_2)
ledger [ zkapp_command ] ) ) )

let () =
match Sys.getenv "PROOF_CACHE_OUT" with
| Some path ->
Yojson.Safe.to_file path @@ Pickles.Proof_cache.to_yojson proof_cache
| None ->
()
end )

0 comments on commit 57f53ca

Please sign in to comment.