123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177(*****************************************************************************)(* *)(* 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. *)(* *)(*****************************************************************************)(** An implementation of {!Tezos_protocol_environment.PROTOCOL} used
in tests. It sets all types to [unit] and implement all functions
as [assert false]. Users of this module should [include] it
and override the functions they need. *)moduleMock_all_unit:Environment_protocol_T.PROTOCOLwithtypeblock_header_data=unitandtypeoperation_data=unitandtypeoperation_receipt=unitandtypevalidation_state=unitandtypeapplication_state=unitandtypeMempool.t=unitandtypeMempool.validation_info=unit=structtypeblock_header_data=unittypeoperation={shell:Tezos_base.Operation.shell_header;protocol_data:block_header_data;}typeoperation_receipt=unittypeoperation_data=unittypeblock_header_metadata=unittypeblock_header={shell:Tezos_base.Block_header.shell_header;protocol_data:block_header_data;}letenvironment_version=Protocol.V0letexpected_context_hash=Environment_context.Resulting_contextletinit_=assertfalsetypenonrecvalidation_state=unittypenonrecapplication_state=unittypemode=|Applicationofblock_header|Partial_validationofblock_header|Constructionof{predecessor_hash:Tezos_crypto.Hashed.Block_hash.t;timestamp:Time.Protocol.t;block_header_data:block_header_data;}|Partial_constructionof{predecessor_hash:Tezos_crypto.Hashed.Block_hash.t;timestamp:Time.Protocol.t;}letbegin_validation_=assertfalseletvalidate_operation?check_signature:_=assertfalseletfinalize_validation_=assertfalseletbegin_application_=assertfalseletapply_operation_=assertfalseletfinalize_application_=assertfalseletrpc_services=Tezos_rpc.Directory.emptyletcompare_operations_=assertfalseletacceptable_pass_=assertfalseletoperation_data_and_receipt_encoding=Data_encoding.conv(Fun.const())(Fun.const((),()))Data_encoding.unitletoperation_data_and_receipt_encoding_with_legacy_attestation_name=operation_data_and_receipt_encodingletoperation_receipt_encoding=Data_encoding.unitletoperation_receipt_encoding_with_legacy_attestation_name=operation_receipt_encodingletoperation_data_encoding=Data_encoding.unitletoperation_data_encoding_with_legacy_attestation_name=operation_data_encodingletblock_header_metadata_encoding_with_legacy_attestation_name=Data_encoding.unitletblock_header_metadata_encoding=Data_encoding.unitletblock_header_data_encoding=Data_encoding.unitletvalidation_passes=[](* Size of the shell header + size of the encoding of {!block_header_data}
(unit, i.e. 0). *)letmax_operation_data_length=32letmax_block_length=0letvalue_of_key~chain_id:_~predecessor_context:_~predecessor_timestamp:_~predecessor_level:_~predecessor_fitness:_~predecessor:_~timestamp:_=assertfalseletset_log_message_consumer_=()moduleMempool=structtypet=unittypevalidation_info=unittypeconflict_handler=existing_operation:Tezos_crypto.Hashed.Operation_hash.t*operation->new_operation:Tezos_crypto.Hashed.Operation_hash.t*operation->[`Keep|`Replace]typeoperation_conflict=|Operation_conflictof{existing:Tezos_crypto.Hashed.Operation_hash.t;new_operation:Tezos_crypto.Hashed.Operation_hash.t;}typeadd_result=|Added|Replacedof{removed:Tezos_crypto.Hashed.Operation_hash.t}|Unchangedtypeadd_error=|Validation_erroroferrortrace|Add_conflictofoperation_conflicttypemerge_error=|Incompatible_mempool|Merge_conflictofoperation_conflictletinit__~head_hash:_~head:_~cache:_=assertfalseletencoding=Data_encoding.unitletadd_operation?check_signature:_?conflict_handler:____=assertfalseletremove_operation()_=assertfalseletmerge?conflict_handler:_()()=assertfalseletoperations()=assertfalseendend