123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *)(* Copyright (c) 2022 Trili Tech, <contact@trili.tech> *)(* *)(* 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. *)(* *)(*****************************************************************************)modulePVM=structtypeboot_sector=stringmoduletypeS=sigvalparse_boot_sector:string->boot_sectoroptionvalpp_boot_sector:Format.formatter->boot_sector->unitincludeSc_rollup_PVM_sig.Sendtype('state,'proof,'output)implementation=(moduleSwithtypestate='stateandtypeproof='proofandtypeoutput_proof='output)typet=Packed:('state,'proof,'output)implementation->t[@@unboxed]endmoduleKind=struct(*
Each time we add a data constructor to [t], we also need:
- to extend [Sc_rollups.all] with this new constructor ;
- to update [Sc_rollups.of_name] and [encoding] ;
- to update [Sc_rollups.wrapped_proof] and [wrapped_proof_encoding].
*)typet=Example_arith|Wasm_2_0_0letall=[Example_arith;Wasm_2_0_0]letto_string=function|Example_arith->"arith"|Wasm_2_0_0->"wasm_2_0_0"letof_string=function|"arith"->SomeExample_arith|"wasm_2_0_0"->SomeWasm_2_0_0|_->Noneletencoding=Data_encoding.string_enum@@List.map(funk->(to_stringk,k))allletppfmt=function|Example_arith->Format.pp_print_stringfmt"arith"|Wasm_2_0_0->Format.pp_print_stringfmt"wasm_2_0_0"letequalxy=match(x,y)with|Example_arith,Example_arith->true|Wasm_2_0_0,Wasm_2_0_0->true|_->falseletexample_arith_pvm=PVM.Packed(moduleSc_rollup_arith.Protocol_implementation)letwasm_2_0_0_pvm=PVM.Packed(moduleSc_rollup_wasm.V2_0_0.Protocol_implementation)letpvm_of=function|Example_arith->example_arith_pvm|Wasm_2_0_0->wasm_2_0_0_pvmend