123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2023 Functori, <contact@functori.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. *)(* *)(*****************************************************************************)moduleHash=Tezos_crypto.Hashed.Smart_rollup_commitment_hashmoduleV1=structtypet={compressed_state:State_hash.t;inbox_level:int32;predecessor:Hash.t;number_of_ticks:int64;}letppfmt{compressed_state;inbox_level;predecessor;number_of_ticks}=Format.fprintffmt"compressed_state: %a@,\
inbox_level: %ld@,\
predecessor: %a@,\
number_of_ticks: %Ld"State_hash.ppcompressed_stateinbox_levelHash.pppredecessornumber_of_ticksletencoding=letopenData_encodinginconv(fun{compressed_state;inbox_level;predecessor;number_of_ticks}->(compressed_state,inbox_level,predecessor,number_of_ticks))(fun(compressed_state,inbox_level,predecessor,number_of_ticks)->{compressed_state;inbox_level;predecessor;number_of_ticks})(obj4(req"compressed_state"State_hash.encoding)(req"inbox_level"int32)(req"predecessor"Hash.encoding)(req"number_of_ticks"int64))lethashcommitment=letcommitment_bytes=Data_encoding.Binary.to_bytes_exnencodingcommitmentinHash.hash_bytes[commitment_bytes]letgenesis_commitment~origination_level~genesis_state_hash={compressed_state=genesis_state_hash;inbox_level=origination_level;predecessor=Hash.zero;number_of_ticks=0L;}endtypeversioned=V1ofV1.tletversioned_encoding=letopenData_encoding.V1inunion[case~title:"smart_rollup_commitment.v1"(Tag0)V1.encoding(functionV1commitment->Somecommitment)(funcommitment->V1commitment);]includeV1letof_versioned=functionV1commitment->commitment[@@inline]letto_versionedcommitment=V1commitment[@@inline]