Shell: remove dead code

This commit is contained in:
Grégoire Henry 2018-10-29 22:08:12 +01:00
parent f458b6119c
commit 91403aa69d
No known key found for this signature in database
GPG Key ID: 827A020B224844F1

View File

@ -25,45 +25,6 @@
open Validation_errors
let rec apply_operations apply_operation state r max_ops ~sort ops =
let open Preapply_result in
Lwt_list.fold_left_s
(fun (state, max_ops, r) (hash, op, parsed_op) ->
apply_operation state max_ops op parsed_op >>= function
| Ok (state, _metadata) ->
let applied = (hash, op) :: r.applied in
Lwt.return (state, max_ops - 1, { r with applied })
| Error errors ->
match classify_errors errors with
| `Branch ->
let branch_refused =
Operation_hash.Map.add hash (op, errors) r.branch_refused in
Lwt.return (state, max_ops, { r with branch_refused })
| `Permanent ->
let refused =
Operation_hash.Map.add hash (op, errors) r.refused in
Lwt.return (state, max_ops, { r with refused })
| `Temporary ->
let branch_delayed =
Operation_hash.Map.add hash (op, errors) r.branch_delayed in
Lwt.return (state, max_ops, { r with branch_delayed }))
(state, max_ops, r)
ops >>= fun (state, max_ops, r) ->
match r.applied with
| _ :: _ when sort ->
let rechecked_operations =
List.filter
(fun (hash, _, _) -> Operation_hash.Map.mem hash r.branch_delayed)
ops in
let remaining = List.length rechecked_operations in
if remaining = 0 || remaining = List.length ops then
Lwt.return (state, max_ops, r)
else
apply_operations apply_operation state r max_ops ~sort rechecked_operations
| _ ->
Lwt.return (state, max_ops, r)
module type T = sig
module Proto: Registered_protocol.T