Fix wrongly marked revelations

Revelations are sometimes marked as skipped or backtracked, but they are
actually still applied. This fix keeps the Applied tag for Reveal operations.
parent b6b2ba2e
Pipeline #28867450 passed with stages
in 18 minutes and 28 seconds
......@@ -595,27 +595,35 @@ let apply_manager_contents
Lwt.return
(`Failure, Failed (manager_kind operation, errors), [])
let skipped_operation_result
: type kind. kind manager_operation -> kind manager_operation_result
= function operation ->
match operation with
| Reveal _ ->
Applied ( Reveal_result : kind successful_manager_operation_result )
| _ -> Skipped (manager_kind operation)
let rec mark_skipped
: type kind.
baker : Signature.Public_key_hash.t -> Level.t -> kind Kind.manager contents_list ->
kind Kind.manager contents_result_list = fun ~baker level -> function
| Single (Manager_operation ({ source ; fee } as op)) ->
| Single (Manager_operation { source ; fee ; operation } ) ->
Single_result
(Manager_operation_result
{ balance_updates =
Delegate.cleanup_balance_updates
[ Contract source, Debited fee ;
Fees (baker, level.cycle), Credited fee ] ;
operation_result = Skipped (manager_kind op.operation) ;
operation_result = skipped_operation_result operation ;
internal_operation_results = [] })
| Cons (Manager_operation ({ source ; fee } as op), rest) ->
| Cons (Manager_operation { source ; fee ; operation } , rest) ->
Cons_result
(Manager_operation_result {
balance_updates =
Delegate.cleanup_balance_updates
[ Contract source, Debited fee ;
Fees (baker, level.cycle), Credited fee ] ;
operation_result = Skipped (manager_kind op.operation) ;
operation_result = skipped_operation_result operation ;
internal_operation_results = [] },
mark_skipped ~baker level rest)
......@@ -707,6 +715,7 @@ let mark_backtracked results =
: type kind. kind manager_operation_result -> kind manager_operation_result
= function
| Failed _ | Skipped _ | Backtracked _ as result -> result
| Applied Reveal_result as result -> result
| Applied result -> Backtracked (result, None) in
mark_contents_list results
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment