12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)type'errort={applied:(Operation_hash.t*Operation.t)list;refused:(Operation.t*'errorlist)Operation_hash.Map.t;outdated:(Operation.t*'errorlist)Operation_hash.Map.t;branch_refused:(Operation.t*'errorlist)Operation_hash.Map.t;branch_delayed:(Operation.t*'errorlist)Operation_hash.Map.t;}letempty={applied=[];refused=Operation_hash.Map.empty;outdated=Operation_hash.Map.empty;branch_refused=Operation_hash.Map.empty;branch_delayed=Operation_hash.Map.empty;}letencodingerror_encoding=letopenData_encodinginletoperation_encoding=merge_objs(obj1(req"hash"Operation_hash.encoding))(dynamic_sizeOperation.encoding)inletrefused_encoding=merge_objs(obj1(req"hash"Operation_hash.encoding))(merge_objs(dynamic_sizeOperation.encoding)(obj1(req"error"error_encoding)))inletbuild_listmap=Operation_hash.Map.bindingsmapinletbuild_maplist=List.fold_right(fun(k,e)m->Operation_hash.Map.addkem)listOperation_hash.Map.emptyinconv(fun{applied;refused;outdated;branch_refused;branch_delayed}->(applied,build_listrefused,build_listoutdated,build_listbranch_refused,build_listbranch_delayed))(fun(applied,refused,outdated,branch_refused,branch_delayed)->letrefused=build_maprefusedinletoutdated=build_mapoutdatedinletbranch_refused=build_mapbranch_refusedinletbranch_delayed=build_mapbranch_delayedin{applied;refused;outdated;branch_refused;branch_delayed})(obj5(req"applied"(listoperation_encoding))(req"refused"(listrefused_encoding))(req"outdated"(listrefused_encoding))(req"branch_refused"(listrefused_encoding))(req"branch_delayed"(listrefused_encoding)))