Prevalidation: fix preapply where applied operations would be reversed

This commit is contained in:
Vincent Botbol 2018-11-26 18:34:45 +01:00
parent 64fd40b77f
commit 030916ed11
No known key found for this signature in database
GPG Key ID: A2CE1BDBED95DA38

View File

@ -298,6 +298,9 @@ let preapply ~predecessor ~timestamp ~protocol_data operations =
(Preapply_result.empty, acc_validation_state)
operations
>>= fun (new_validation_result, new_validation_state) ->
(* Applied operations are reverted ; revert to the initial ordering *)
let new_validation_result =
{ new_validation_result with applied = List.rev new_validation_result.applied } in
Lwt.return (acc_validation_result @ [new_validation_result], new_validation_state)
) ([], validation_state) operations
>>= fun (validation_result_list, validation_state) ->