@@ -17,7 +17,7 @@ module Account_spec = struct
17
17
; nonce : int
18
18
} [@@ deriving sexp ]
19
19
20
- let rec find_in_test_keys ?( n = 0 ) ( x : Keypair.t ) =
20
+ let find_in_test_keys ( x : Keypair.t ) = Array. findi_exn test_keys ~f: ( fun _ -> Keypair. equal x) |> fst
21
21
if Keypair. equal test_keys.(n) x then n
22
22
else find_in_test_keys x ~n: (n+ 1 )
23
23
@@ -231,7 +231,7 @@ let gen_commands_from_specs (sequence:Command_spec.t array) test : (User_command
231
231
~location_of_account:
232
232
(Mina_ledger.Ledger. location_of_account best_tip_ledger) )
233
233
zkapp) |> User_command. Zkapp_command
234
- | Payment {sender;fee;amount;receiver_idx} ->
234
+ | Payment {sender = { key_idx = sender_idx ;nonce;_} ;fee;amount;receiver_idx} ->
235
235
mk_payment ~sender_idx: sender.key_idx ~fee ~nonce:
236
236
sender.nonce ~receiver_idx
237
237
~amount ()
@@ -259,22 +259,22 @@ let%test_unit "Handle transition frontier diff (permission send tx updated)" =
259
259
let test = Thread_safe. block_on_async_exn (fun () -> setup_test () ) in
260
260
let init_ledger_state = ledger_snapshot test in
261
261
let % bind (prefix,major,minor,minor_account_spec,major_account_spec) = gen_branches init_ledger_state ~permission_change: true ~limited_capacity: true () in
262
- return (test,init_ledger_state, prefix,major,minor,major_account_spec,minor_account_spec))
263
- ~f: (fun (test ,_init_ledger_state , prefix_specs ,major_specs ,minor_specs ,major_account_spec ,minor_account_spec ) ->
262
+ return (test,prefix,major,minor,major_account_spec,minor_account_spec))
263
+ ~f: (fun (test ,prefix_specs ,major_specs ,minor_specs ,major_account_spec ,minor_account_spec ) ->
264
264
Thread_safe. block_on_async_exn (fun () ->
265
265
let log_prefix = Array. map prefix_specs ~f: (fun cmd ->
266
266
let sender = Command_spec. sender cmd in
267
267
let content = Printf. sprintf ! " %{sexp: Public_key.t} %{sexp: Command_spec.t}" test_keys.(sender.key_idx).public_key cmd in
268
268
`String content
269
269
) |> Array. to_list in
270
270
271
- let log_major = Array. map minor_specs ~f: (fun cmd ->
271
+ let log_major = Array. map major_specs ~f: (fun cmd ->
272
272
let sender = Command_spec. sender cmd in
273
273
let content = Printf. sprintf ! " %{sexp: Public_key.t} %{sexp: Command_spec.t}" test_keys.(sender.key_idx).public_key cmd in
274
274
`String content
275
275
) |> Array. to_list in
276
276
277
- let log_minor = Array. map major_specs ~f: (fun cmd ->
277
+ let log_minor = Array. map minor_specs ~f: (fun cmd ->
278
278
let sender = Command_spec. sender cmd in
279
279
let content = Printf. sprintf ! " %{sexp: Public_key.t} %{sexp: Command_spec.t}" test_keys.(sender.key_idx).public_key cmd in
280
280
`String content
@@ -299,7 +299,7 @@ let%test_unit "Handle transition frontier diff (permission send tx updated)" =
299
299
let minor = gen_commands_from_specs (Array. concat [minor_specs]) test in
300
300
let major = gen_commands_from_specs (Array. concat [major_specs]) test in
301
301
302
- let % bind () = advance_chain test (prefix @ major) in
302
+ let % bind () = commit_commands test (prefix @ major) in
303
303
304
304
Test.Resource_pool. handle_transition_frontier_diff_inner
305
305
~new_commands: (List. map ~f: mk_with_status (prefix @ major))
0 commit comments