From 030916ed11c4528ae60d7b0a858e514942465afb Mon Sep 17 00:00:00 2001 From: Vincent Botbol Date: Mon, 26 Nov 2018 18:34:45 +0100 Subject: [PATCH] Prevalidation: fix preapply where applied operations would be reversed --- src/lib_shell/prevalidation.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib_shell/prevalidation.ml b/src/lib_shell/prevalidation.ml index 9dead8fdd..35b509a91 100644 --- a/src/lib_shell/prevalidation.ml +++ b/src/lib_shell/prevalidation.ml @@ -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) ->