Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nholland94 committed Oct 26, 2022
1 parent a0d1235 commit 25388a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/lib/mina_base/transaction_validator.ml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
open Base

let within_mask l ~f =
let l' =
let mask =
Ledger.register_mask l (Ledger.Mask.create ~depth:(Ledger.depth l) ())
in
let r = f l' in
if Result.is_ok r then Ledger.commit l' ;
let r = f mask in
if Result.is_ok r then Ledger.commit mask ;
ignore
(Ledger.unregister_mask_exn ~loc:Caml.__LOC__ l' : Ledger.unattached_mask) ;
(Ledger.unregister_mask_exn ~loc:Caml.__LOC__ mask : Ledger.unattached_mask) ;
r

let apply_user_command ~constraint_constants ~txn_global_slot l uc =
Expand Down
7 changes: 4 additions & 3 deletions src/lib/staged_ledger/staged_ledger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1778,13 +1778,14 @@ module T = struct
|> not
let with_ledger_mask base_ledger ~f =
let l =
let mask =
Ledger.register_mask base_ledger
(Ledger.Mask.create ~depth:(Ledger.depth base_ledger) ())
in
let r = f l in
let r = f mask in
ignore
(Ledger.unregister_mask_exn ~loc:Caml.__LOC__ l : Ledger.unattached_mask) ;
( Ledger.unregister_mask_exn ~loc:Caml.__LOC__ mask
: Ledger.unattached_mask ) ;
r
let create_diff
Expand Down

0 comments on commit 25388a0

Please sign in to comment.