File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,9 @@ module Make (Inputs : Intf.Inputs.DATABASE) = struct
282282 let addr = Addr. of_int_exn ~ledger_depth: mdb.depth index in
283283 get mdb (Location. Account addr)
284284
285- let get_at_index_exn mdb index = get_at_index mdb index |> Option. value_exn
285+ let get_at_index_exn mdb index =
286+ get_at_index mdb index
287+ |> Option. value_exn ~message: " Expected account at index" ~here: [% here]
286288
287289 let all_accounts (t : t ) =
288290 match Account_location. last_location_address t with
@@ -584,7 +586,9 @@ module Make (Inputs : Intf.Inputs.DATABASE) = struct
584586
585587 let iteri t ~f =
586588 iteri_untrusted t ~f: (fun index account_opt ->
587- f index (Option. value_exn account_opt) )
589+ f index
590+ (Option. value_exn ~message: " Expected account at index" ~here: [% here]
591+ account_opt ) )
588592
589593 (* TODO : if key-value store supports iteration mechanism, like RocksDB,
590594 maybe use that here, instead of loading all accounts into memory See Issue
Original file line number Diff line number Diff line change @@ -886,7 +886,8 @@ module Make (Inputs : Inputs_intf.S) = struct
886886
887887 let get_at_index_exn t index =
888888 assert_is_attached t ;
889- get_at_index t index |> Option. value_exn
889+ get_at_index t index
890+ |> Option. value_exn ~message: " Expected account at index" ~here: [% here]
890891
891892 let set_at_index_exn t index account =
892893 assert_is_attached t ;
@@ -918,7 +919,9 @@ module Make (Inputs : Inputs_intf.S) = struct
918919
919920 let iteri t ~f =
920921 iteri_untrusted t ~f: (fun index account_opt ->
921- f index (Option. value_exn account_opt) )
922+ f index
923+ (Option. value_exn ~message: " Expected account at index" ~here: [% here]
924+ account_opt ) )
922925
923926 let foldi_with_ignored_accounts t ignored_accounts ~init ~f =
924927 assert_is_attached t ;
You can’t perform that action at this time.
0 commit comments