123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Nomadic Development. <contact@tezcore.com> *)(* Copyright (c) 2018-2022 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. *)(* *)(*****************************************************************************)moduletypeFILTER=sigmoduleProto:Registered_protocol.TmoduleMempool:sigtypeconfigvalconfig_encoding:configData_encoding.tvaldefault_config:configtypestatevalinit:config->?validation_state:Proto.validation_state->predecessor:Tezos_base.Block_header.t->unit->statetzresultLwt.tvalon_flush:config->state->?validation_state:Proto.validation_state->predecessor:Tezos_base.Block_header.t->unit->statetzresultLwt.tvalremove:filter_state:state->Operation_hash.t->statevalprecheck:config->filter_state:state->validation_state:Proto.validation_state->Operation_hash.t->Proto.operation->nb_successful_prechecks:int->[`Passed_precheckofstate*Proto.validation_state*[`No_replace|`ReplaceofOperation_hash.t*Prevalidator_classification.error_classification]|`Undecided|Prevalidator_classification.error_classification]Lwt.tvalpre_filter:config->filter_state:state->?validation_state_before:Proto.validation_state->Proto.operation->[`Passed_prefilterofPrevalidator_pending_operations.priority|Prevalidator_classification.error_classification]Lwt.tvalpost_filter:config->filter_state:state->validation_state_before:Proto.validation_state->validation_state_after:Proto.validation_state->Proto.operation*Proto.operation_receipt->[`Passed_postfilterofstate|`Refusedoftztrace]Lwt.tendendmoduleNo_filter(Proto:Registered_protocol.T):FILTERwithmoduleProto=Proto=structmoduleProto=ProtomoduleMempool=structtypeconfig=unitletconfig_encoding=Data_encoding.emptyletdefault_config=()typestate=unitletinit_?validation_state:_~predecessor:_()=Lwt_result_syntax.return_unitletremove~filter_state_=filter_stateleton_flush__?validation_state:_~predecessor:_()=Lwt_result_syntax.return_unitletprecheck_~filter_state:_~validation_state:___~nb_successful_prechecks:_=Lwt.return`Undecidedletpre_filter_~filter_state:_?validation_state_before:__=Lwt.return@@`Passed_prefilter(`Low[])letpost_filter_~filter_state~validation_state_before:_~validation_state_after:__=Lwt.return(`Passed_postfilterfilter_state)endend