123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 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. *)(* *)(*****************************************************************************)(** Type of a mockup environment *)typet={chain:Chain_id.t;rpc_context:Tezos_protocol_environment.rpc_context;protocol_data:bytes;}typemockup_context=tmoduletypePROTOCOL=sigvalhash:Protocol_hash.tincludeTezos_protocol_environment.PROTOCOLend(** The module type of a mockup environment. Modules of this type should be
prepared protocol-side and registered in {!Registration} to become available to the
mockup facility. *)moduletypeMOCKUP=sigtypeparameterstypeprotocol_constantsvalparameters_encoding:parametersData_encoding.tvaldefault_parameters:parametersvalprotocol_constants_encoding:protocol_constantsData_encoding.t(** The content equivalent to the default value of [--protocol-constants] *)valdefault_protocol_constants:Tezos_client_base.Client_context.full->protocol_constantstzresultLwt.t(** The content equivalent to the default value of [--bootstrap-accounts] *)valdefault_bootstrap_accounts:Tezos_client_base.Client_context.full->stringtzresultLwt.tvalprotocol_hash:Protocol_hash.tmoduleProtocol:PROTOCOLmoduleBlock_services:moduletypeofTezos_shell_services.Block_services.Make(Protocol)(Protocol)valdirectory:Tezos_protocol_environment.rpc_contextTezos_rpc.Directory.tvalinit:cctxt:Tezos_client_base.Client_context.printer->parameters:parameters->constants_overrides_json:Data_encoding.jsonoption->bootstrap_accounts_json:Data_encoding.jsonoption->mockup_contexttzresultLwt.tvalmigrate:mockup_context->mockup_contexttzresultLwt.tendmoduletypeS=sigmoduletypeMOCKUP=MOCKUPmoduletypePROTOCOL=PROTOCOLtypemockup_context=ttypemockup_environment=(moduleMOCKUP)valregister_mockup_environment:mockup_environment->unitvalget_registered_environments:unit->mockup_environmentlistendmoduletypeT=sigincludeSmoduletypeS=SmoduleInternal_for_tests:sig(** Make new registration modules instead of one global shared state. *)moduleMake():Sendend