1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* Copyright (c) 2018-2021 Nomadic Labs. <contact@nomadic-labs.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. *)(* *)(*****************************************************************************)openEnvironment_contextopenEnvironment_protocol_TmoduletypeT=sigincludeTezos_protocol_environment_sigs.V0.TwithtypeFormat.formatter=Format.formatterandtype'aData_encoding.t='aData_encoding.tandtype'aData_encoding.lazy_t ='aData_encoding.lazy_tandtype'aLwt.t='aLwt.tandtype('a,'b)Pervasives.result=('a,'b)resultandtypeChain_id.t=Tezos_crypto.Hashed.Chain_id.tandtypeBlock_hash.t=Tezos_crypto.Hashed.Block_hash.tandtypeOperation_hash.t=Tezos_crypto.Hashed.Operation_hash.tandtypeOperation_list_hash.t=Tezos_crypto.Hashed.Operation_list_hash.tandtypeOperation_list_list_hash.t=Tezos_crypto.Hashed.Operation_list_list_hash.tandtypeContext.t=Context.tandtypeContext_hash.t=Tezos_crypto.Hashed.Context_hash.tandtypeProtocol_hash.t=Tezos_crypto.Hashed.Protocol_hash.tandtypeTime.t=Time.Protocol.tandtypeMBytes.t=Tezos_protocol_environment_structs.V0.MBytes.tandtypeOperation.shell_header=Operation.shell_headerandtypeOperation.t=Operation.tandtypeBlock_header.shell_header=Block_header.shell_headerandtypeBlock_header.t=Block_header.tandtype'aRPC_directory.t='aTezos_rpc.Directory.tandtypeEd25519.Public_key_hash.t=Signature.Ed25519.Public_key_hash.tandtypeEd25519.Public_key.t=Signature.Ed25519.Public_key.tandtypeEd25519.t=Signature.Ed25519.tandtypeSecp256k1.Public_key_hash.t=Signature.Secp256k1.Public_key_hash.tandtypeSecp256k1.Public_key.t=Signature.Secp256k1.Public_key.tandtypeSecp256k1.t=Signature.Secp256k1.tandtypeP256.Public_key_hash.t=Signature.P256.Public_key_hash.tandtypeP256.Public_key.t=Signature.P256.Public_key.tandtypeP256.t=Signature.P256.tandtypeSignature.public_key_hash=Signature.V0.public_key_hashandtypeSignature.public_key=Signature.V0.public_keyandtypeSignature.t=Signature.V0.tandtypeSignature.watermark =Signature.V0.watermarkandtype'aMicheline.canonical='aMicheline.canonicalandtypeZ.t=Z.tandtype('a,'b)Micheline.node=('a,'b)Micheline.nodeandtypeData_encoding.json_schema=Data_encoding.json_schemaandtype('a,'b)RPC_path.t=('a,'b)Tezos_rpc.Path.tandtypeRPC_service.meth=Tezos_rpc.Service.methandtype(+'m,'pr,'p,'q,'i,'o)RPC_service.t=('m,'pr,'p,'q,'i,'o)Tezos_rpc.Service.tandtypeError_monad.shell_error=Error_monad.errortypeerror+=Ecoproto_errorofError_monad.errorvalwrap_error:'aError_monad.tzresult->'atzresultmoduleLift(P:Updater.PROTOCOL):PROTOCOLwithtypeblock_header_data=P.block_header_dataandtypeblock_header_metadata=P.block_header_metadataandtypeblock_header=P.block_headerandtypeoperation_data=P.operation_dataandtypeoperation_receipt=P.operation_receiptandtypeoperation=P.operationandtypevalidation_state=P.validation_stateclass['chain,'block]proto_rpc_context:Tezos_rpc.Context.t->(unit,(unit*'chain)*'block)RPC_path.t->['chain*'block]RPC_context.simpleclass['block]proto_rpc_context_of_directory:('block->RPC_context.t)->RPC_context.tRPC_directory.t->['block]RPC_context.simpleendmoduleMake(Param:sigvalname:stringend)()=structmoduleCamlinternalFormatBasics=CamlinternalFormatBasicsincludeStdlib(* The modules provided in the [_struct.V0.M] pack are meant specifically to
shadow modules from [Stdlib]/[Base]/etc. with backwards compatible
versions. Thus we open the module, hiding the incompatible, newer modules.
*)openTezos_protocol_environment_structs.V0modulePervasives=StdlibmoduleCompare=ComparemoduleList=ListmoduleBytes=structincludeBytesincludeEndianBytes.BigEndianendmoduleString=structincludeStringincludeEndianString.BigEndianmoduleLE=EndianString.LittleEndianendmoduleSet=Stdlib.SetmoduleMap=Stdlib.MapmoduleInt32=Int32moduleInt64=Int64moduleFormat=FormatmoduleOption=OptionmoduleMBytes=MBytesmoduleRaw_hashes=structletsha256=Tezos_crypto.Hacl.Hash.SHA256.digestletsha512=Tezos_crypto.Hacl.Hash.SHA512.digestletblake2bmsg=Tezos_crypto.Blake2B.to_bytes(Tezos_crypto.Blake2B.hash_bytes[msg])endmoduleZ=structincludeZletto_bits?(pad_to=0)z=letbits=to_bitszinletlen=Pervasives.((numbitsz+7)/8)inletfull_len=Tezos_stdlib.Compare.Int.maxpad_toleniniffull_len=0thenMBytes.create0elseletres=MBytes.createfull_leninBytes.fillres0full_len'\000';MBytes.blit_of_stringbits0res0len;resletof_bitsbytes=of_bits(MBytes.to_stringbytes)endmoduleLwt=LwtmoduleLwt_list=Lwt_listmoduleData_encoding=structincludeData_encodingletdefname?title?descriptionencoding=def(Param.name^"."^name)?title?descriptionencodingendmoduleTime=Time.ProtocolmoduleEd25519=Ed25519moduleSecp256k1=Secp256k1moduleP256=P256moduleSignature=SignaturemoduleS=structmoduletypeT=Tezos_base.S.TmoduletypeHASHABLE=Tezos_base.S.HASHABLEmoduletypeMINIMAL_HASH=Tezos_crypto.Intfs.MINIMAL_HASHmoduletypeB58_DATA=sigtypetvalto_b58check:t->stringvalto_short_b58check:t->stringvalof_b58check_exn:string->tvalof_b58check_opt:string->toptiontypeTezos_crypto.Base58.data+=Dataoftvalb58check_encoding:tTezos_crypto.Base58.encodingendmoduletypeRAW_DATA=sigtypetvalsize:int(* in bytes *)valto_bytes:t->MBytes.tvalof_bytes_opt:MBytes.t->toptionvalof_bytes_exn:MBytes.t->tendmoduletypeENCODER=sigtypetvalencoding:tData_encoding.tvalrpc_arg:tTezos_rpc.Arg.tendmoduletypeSET=S.SETmoduletypeMAP=S.MAPmoduletypeINDEXES=sigtypetvalto_path:t->stringlist->stringlistvalof_path:stringlist->toptionvalof_path_exn:stringlist->tvalprefix_path:string->stringlistvalpath_length:intmoduleSet:sigincludeSETwithtypeelt=tvalencoding:tData_encoding.tendmoduleMap:sigincludeMAPwithtypekey=tvalencoding:'aData_encoding.t->'atData_encoding.tendendmoduletypeHASH=sigincludeMINIMAL_HASHincludeRAW_DATAwithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tincludeINDEXESwithtypet:=tendmoduletypeMERKLE_TREE=sigtypeeltincludeHASHvalcompute:eltlist->tvalempty:ttypepath=Leftofpath*t|Rightoft*path|Opvalcompute_path:eltlist->int->pathvalcheck_path:path->elt->t*intvalpath_encoding:pathData_encoding.tendmoduletypeSIGNATURE=sigmodulePublic_key_hash:sigtypetvalpp:Format.formatter->t->unitvalpp_short:Format.formatter->t->unitincludeCompare.Swithtypet:=tincludeRAW_DATAwithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tincludeINDEXESwithtypet:=tvalzero:tendmodulePublic_key:sigtypetvalpp:Format.formatter->t->unitincludeCompare.Swithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tvalhash:t->Public_key_hash.tendtypetvalpp:Format.formatter->t->unitincludeRAW_DATAwithtypet:=tincludeCompare.Swithtypet:=tincludeB58_DATAwithtypet:=tincludeENCODERwithtypet:=tvalzero:ttypewatermark(** Check a signature *)valcheck:?watermark:watermark->Public_key.t->t->MBytes.t->boolendendmoduleError_core=structincludeTezos_error_monad.Core_maker.Make(structletid=Format.asprintf"proto.%s."Param.nameend)(Tezos_protocol_environment_structs.V0.Error_monad_trace_eval)leterror_encoding=Data_encoding.dynamic_sizeerror_encodingendtypeerror_category=Error_core.error_categorytypeerror+=Ecoproto_errorofError_core.errormoduleWrapped_error_monad=structtypeunwrapped=Error_core.error=..include(Error_core:sigincludeTezos_error_monad.Sig.COREwithtypeerror:=unwrappedandtypeerror_category=error_categoryend)letunwrap=functionEcoproto_errorecoerror->Someecoerror|_->Noneletwrapecoerror=Ecoproto_errorecoerrorendmoduleError_monad=structtype'ashell_tzresult='aError_monad.tzresulttypeshell_error=Error_monad.error=..includeError_coreincludeTezos_error_monad.TzLwtreslib.MonadincludeTezos_error_monad.Monad_maker.Make(Error_core)(TzTrace)(Tezos_error_monad.TzLwtreslib.Monad)(* below is for backward compatibility *)includeError_monad_infix_globalsincludeError_monad_traversorsincludeError_monad_trace_evalletfaile=Lwt.return_error(TzTrace.makee)leterrore=Error(TzTrace.makee)(* Shouldn't be used, only to keep the same environment interface *)letclassify_errors=function|[]->`Temporary|error::_->(find_info_of_errorerror).categoryendlet()=letid=Format.asprintf"proto.%s.wrapper"Param.nameinregister_wrapped_error_kind(moduleWrapped_error_monad)~id~title:("Error returned by protocol "^Param.name)~description:("Wrapped error for economic protocol "^Param.name^".")letwrap_error=function|Ok_asok->ok|Errorerrors->Error(List.map(funerror->Ecoproto_errorerror)errors)moduleChain_id=Chain_idmoduleBlock_hash=Block_hashmoduleOperation_hash=Operation_hashmoduleOperation_list_hash=Operation_list_hashmoduleOperation_list_list_hash=Operation_list_list_hashmoduleContext_hash=Context_hashmoduleProtocol_hash=Protocol_hashmoduleBlake2B=Blake2BmoduleFitness=FitnessmoduleOperation=OperationmoduleBlock_header=Block_headermoduleProtocol=ProtocolmoduleRPC_arg=Tezos_rpc.ArgmoduleRPC_path=Tezos_rpc.PathmoduleRPC_query=Tezos_rpc.QuerymoduleRPC_service=Tezos_rpc.ServicemoduleRPC_answer=structtype'ot=[`Okof'o(* 200 *)|`OkStreamof'ostream(* 200 *)|`Createdofstringoption(* 201 *)|`No_content(* 204 *)|`UnauthorizedofError_monad.errorlistoption(* 401 *)|`ForbiddenofError_monad.errorlistoption(* 403 *)|`Not_foundofError_monad.errorlistoption(* 404 *)|`ConflictofError_monad.errorlistoption(* 409 *)|`ErrorofError_monad.errorlistoption(* 500 *)]and'astream='aResto_directory.Answer.stream={next:unit->'aoptionLwt.t;shutdown:unit->unit;}letreturnx=Lwt.return(`Okx)letreturn_chunkedx=Lwt.return(`OkChunkx)letreturn_streamx=Lwt.return(`OkStreamx)letnot_found=Lwt.return(`Not_foundNone)letfailerr=Lwt.return(`Error(Someerr))endmoduleRPC_directory=structincludeTezos_protocol_environment_structs.V0.RPC_directoryletgen_registerdirservicehandler=letopenLwt_syntaxingen_registerdirservice(funpqi->let*r=handlerpqiinmatchrwith|`Oko->RPC_answer.return_chunkedo|`OkStreams->RPC_answer.return_streams|`Createds->Lwt.return(`Createds)|`No_content->Lwt.return`No_content|`Unauthorizede->lete=Option.mape~f:(List.map(fune->Ecoproto_errore))inLwt.return(`Unauthorizede)|`Forbiddene->lete=Option.mape~f:(List.map(fune->Ecoproto_errore))inLwt.return(`Forbiddene)|`Not_founde->lete=Option.mape~f:(List.map(fune->Ecoproto_errore))inLwt.return(`Not_founde)|`Conflicte->lete=Option.mape~f:(List.map(fune->Ecoproto_errore))inLwt.return(`Conflicte)|`Errore->lete=Option.mape~f:(List.map(fune->Ecoproto_errore))inLwt.return(`Errore))letregisterdirservicehandler=letopenLwt_syntaxingen_registerdirservice(funpqi->let*r=handlerpqiinmatchrwith|Oko->RPC_answer.returno|Errore->RPC_answer.faile)letopt_registerdirservicehandler=letopenLwt_syntaxingen_registerdirservice(funpqi->let*r=handlerpqiinmatchrwith|Ok(Someo)->RPC_answer.returno|OkNone->RPC_answer.not_found|Errore->RPC_answer.faile)letlwt_registerdirservicehandler=letopenLwt_syntaxingen_registerdirservice(funpqi->let*o=handlerpqiinRPC_answer.returno)openCurryletregister0rootsf=registerroots(curryZf)letregister1rootsf=registerroots(curry(SZ)f)letregister2rootsf=registerroots(curry(S(SZ))f)letregister3rootsf=registerroots(curry(S(S(SZ)))f)letregister4rootsf=registerroots(curry(S(S(S(SZ))))f)letregister5rootsf=registerroots(curry(S(S(S(S(SZ)))))f)letopt_register0rootsf=opt_registerroots(curryZf)letopt_register1rootsf=opt_registerroots(curry(SZ)f)letopt_register2rootsf=opt_registerroots(curry(S(SZ))f)letopt_register3rootsf=opt_registerroots(curry(S(S(SZ)))f)letopt_register4rootsf=opt_registerroots(curry(S(S(S(SZ))))f)letopt_register5rootsf=opt_registerroots(curry(S(S(S(S(SZ)))))f)letgen_register0rootsf=gen_registerroots(curryZf)letgen_register1rootsf=gen_registerroots(curry(SZ)f)letgen_register2rootsf=gen_registerroots(curry(S(SZ))f)letgen_register3rootsf=gen_registerroots(curry(S(S(SZ)))f)letgen_register4rootsf=gen_registerroots(curry(S(S(S(SZ))))f)letgen_register5rootsf=gen_registerroots(curry(S(S(S(S(SZ)))))f)letlwt_register0rootsf=lwt_registerroots(curryZf)letlwt_register1rootsf=lwt_registerroots(curry(SZ)f)letlwt_register2rootsf=lwt_registerroots(curry(S(SZ))f)letlwt_register3rootsf=lwt_registerroots(curry(S(S(SZ)))f)letlwt_register4rootsf=lwt_registerroots(curry(S(S(S(SZ))))f)letlwt_register5rootsf=lwt_registerroots(curry(S(S(S(S(SZ)))))f)endmoduleRPC_context=structtypet=rpc_contextclasstype['pr]simple=objectmethodcall_proto_service0:'m'q'i'o.(([<RPC_service.meth]as'm),t,t,'q,'i,'o)RPC_service.t->'pr->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service1:'m'a'q'i'o.(([<RPC_service.meth]as'm),t,t*'a,'q,'i,'o)RPC_service.t->'pr->'a->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service2:'m'a'b'q'i'o.(([<RPC_service.meth]as'm),t,(t*'a)*'b,'q,'i,'o)RPC_service.t->'pr->'a->'b->'q->'i->'oError_monad.shell_tzresultLwt.tmethodcall_proto_service3:'m'a'b'c'q'i'o.(([<RPC_service.meth]as'm),t,((t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'pr->'a->'b->'c->'q->'i->'oError_monad.shell_tzresultLwt.tendletmake_call0s(ctxt:_simple)=ctxt#call_proto_service0sletmake_call0=(make_call0:_->_simple->_:>_->_#simple->_)letmake_call1s(ctxt:_simple)=ctxt#call_proto_service1sletmake_call1=(make_call1:_->_simple->_:>_->_#simple->_)letmake_call2s(ctxt:_simple)=ctxt#call_proto_service2sletmake_call2=(make_call2:_->_simple->_:>_->_#simple->_)letmake_call3s(ctxt:_simple)=ctxt#call_proto_service3sletmake_call3=(make_call3:_->_simple->_:>_->_#simple->_)letmake_opt_call0sctxtblockqi=letopenLwt_syntaxinlet*r=make_call0sctxtblockqiinmatchrwith|Error[Tezos_rpc.Context.Not_found_]->Lwt.return_okNone|Error_asv->Lwt.returnv|Okv->Lwt.return_ok(Somev)letmake_opt_call1sctxtblocka1qi=letopenLwt_syntaxinlet*r=make_call1sctxtblocka1qiinmatchrwith|Error[Tezos_rpc.Context.Not_found_]->Lwt.return_okNone|Error_asv->Lwt.returnv|Okv->Lwt.return_ok(Somev)letmake_opt_call2sctxtblocka1a2qi=letopenLwt_syntaxinlet*r=make_call2sctxtblocka1a2qiinmatchrwith|Error[Tezos_rpc.Context.Not_found_]->Lwt.return_okNone|Error_asv->Lwt.returnv|Okv->Lwt.return_ok(Somev)letmake_opt_call3sctxtblocka1a2a3qi=letopenLwt_syntaxinlet*r=make_call3sctxtblocka1a2a3qiinmatchrwith|Error[Tezos_rpc.Context.Not_found_]->Lwt.return_okNone|Error_asv->Lwt.returnv|Okv->Lwt.return_ok(Somev)endmoduleMicheline=structincludeMichelineincludeTezos_micheline.Micheline_encodingletcanonical_encoding_v1~variantencoding=canonical_encoding_v1~variant:(Param.name^"."^variant)encodingletcanonical_encoding~variantencoding=canonical_encoding_v0~variant:(Param.name^"."^variant)encodingendmoduleLogging=Legacy_loggingmoduleUpdater=structtypenonrecvalidation_result=validation_result={context:Context.t;fitness:Fitness.t;message:stringoption;max_operations_ttl:int;last_allowed_fork_level:Int32.t;}typenonrecquota=quota={max_size:int;max_op:intoption}typenonrecrpc_context=rpc_context={block_hash:Block_hash.t;block_header:Block_header.shell_header;context:Context.t;}letactivate=Context.set_protocolletfork_test_chain=Context.fork_test_chainmoduletypePROTOCOL=Environment_protocol_T_V0.Twithtypecontext:=Context.tandtypequota:=quotaandtypevalidation_result:=validation_resultandtyperpc_context:=rpc_contextandtypetztrace:=Error_monad.tztraceandtype'atzresult:='aError_monad.tzresultendmoduleBase58=structincludeTezos_crypto.Base58letsimple_encodeencs=simple_encodeencsletsimple_decodeencs=simple_decodeencsincludeMake(structtypecontext=Context.tend)letdecodes=decodesendmoduleContext=structincludeContextletset=addletget=findletdir_mem=mem_treeletremove_rec=removeletcopyctxt~from~to_=letopenLwt_syntaxinlet*sub_tree=find_treectxtfrominTezos_error_monad.TzLwtreslib.Option.map_s(add_treectxtto_)sub_treeletfold_keyssroot~init~f=Context.foldsroot~order:`Sorted~init~f:(funkvacc->letk=root@kinmatchTree.kindvwith`Value->fkacc|`Tree->Lwt.returnacc)letfoldtroot~init~f=Context.fold~depth:(`Eq1)troot~order:`Sorted~init~f:(funkvacc->letk=root@kinmatchTree.kindvwith|`Value->f(`Keyk)acc|`Tree->f(`Dirk)acc)letkeyst=fold_keyst~init:[]~f:(funkacc->Lwt.return(k::acc))letregister_resolver=Base58.register_resolverletcompletectxts=Base58.completectxtsletdel=removeendmoduleLiftV0(P:Updater.PROTOCOL)=structincludePletbegin_partial_application~chain_id~ancestor_context~predecessor_timestamp~predecessor_fitnessraw_block=letopenLwt_syntaxinlet+r=begin_partial_application~chain_id~ancestor_context~predecessor_timestamp~predecessor_fitnessraw_blockinwrap_errorrletbegin_application~chain_id~predecessor_context~predecessor_timestamp~predecessor_fitnessraw_block=letopenLwt_syntaxinlet+r=begin_application~chain_id~predecessor_context~predecessor_timestamp~predecessor_fitnessraw_blockinwrap_errorrletbegin_construction~chain_id~predecessor_context~predecessor_timestamp~predecessor_level~predecessor_fitness~predecessor~timestamp?protocol_data()=letopenLwt_syntaxinlet+r=begin_construction~chain_id~predecessor_context~predecessor_timestamp~predecessor_level~predecessor_fitness~predecessor~timestamp?protocol_data()inwrap_errorrletcurrent_contextc=letopenLwt_syntaxinlet+r=current_contextcinwrap_errorrletapply_operationco=letopenLwt_syntaxinlet+r=apply_operationcoinwrap_errorrletfinalize_blockc=letopenLwt_syntaxinlet+r=finalize_blockcinwrap_errorrletinitcbh=letopenLwt_syntaxinlet+r=initcbhinwrap_errorrendmoduleLift(P:Updater.PROTOCOL)=structincludeIgnoreCaches(Environment_protocol_T.V0toV10(LiftV0(P)))letset_log_message_consumer _=()letenvironment_version=Protocol.V0letexpected_context_hash=Resulting_contextendclass['chain,'block]proto_rpc_context(t:Tezos_rpc.Context.t)(prefix:(unit,(unit*'chain)*'block)RPC_path.t)=objectmethodcall_proto_service0:'m'q'i'o.(([< RPC_service.meth]as'm),RPC_context.t,RPC_context.t,'q,'i,'o)RPC_service.t->'chain*'block->'q->'i->'otzresultLwt.t=funs(chain,block)qi->lets=RPC_service.subst0sinlets=RPC_service.prefixprefixsint#call_services(((),chain),block)qimethodcall_proto_service1:'m'a'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,RPC_context.t*'a,'q,'i,'o)RPC_service.t->'chain*'block->'a->'q->'i->'otzresultLwt.t=funs(chain,block)a1qi->lets=RPC_service.subst1sinlets=RPC_service.prefixprefixsint#call_services((((),chain),block),a1)qimethodcall_proto_service2:'m'a'b'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,(RPC_context.t*'a)*'b,'q,'i,'o)RPC_service.t->'chain*'block->'a->'b->'q->'i->'otzresultLwt.t=funs(chain,block)a1a2qi->lets=RPC_service.subst2sinlets=RPC_service.prefixprefixsint#call_services(((((),chain),block),a1),a2)qimethodcall_proto_service3:'m'a'b'c'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,((RPC_context.t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'chain*'block->'a->'b->'c->'q->'i->'otzresultLwt.t=funs(chain,block)a1a2a3qi->lets=RPC_service.subst3sinlets=RPC_service.prefixprefixsint#call_services((((((),chain),block),a1),a2),a3)qiendclass['block]proto_rpc_context_of_directoryconvdir:['block]RPC_context.simple=letlookup=newTezos_rpc.Context.of_directorydirinobjectmethodcall_proto_service0:'m'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,RPC_context.t,'q,'i,'o)RPC_service.t->'block->'q->'i->'otzresultLwt.t=funsblockqi->letrpc_context=convblockinlookup#call_servicesrpc_contextqimethodcall_proto_service1:'m'a'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,RPC_context.t*'a,'q,'i,'o)RPC_service.t->'block->'a->'q->'i->'otzresultLwt.t=funsblocka1qi->letrpc_context=convblockinlookup#call_services(rpc_context,a1)qimethodcall_proto_service2:'m'a'b'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,(RPC_context.t*'a)*'b,'q,'i,'o)RPC_service.t->'block->'a->'b->'q->'i->'otzresultLwt.t=funsblocka1a2qi->letrpc_context=convblockinlookup#call_services((rpc_context,a1),a2)qimethodcall_proto_service3:'m'a'b'c'q'i'o.(([<RPC_service.meth]as'm),RPC_context.t,((RPC_context.t*'a)*'b)*'c,'q,'i,'o)RPC_service.t->'block->'a->'b->'c->'q->'i->'otzresultLwt.t=funsblocka1a2a3qi->letrpc_context=convblockinlookup#call_services(((rpc_context,a1),a2),a3)qiendend