123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.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. *)(* *)(*****************************************************************************)openError_monadincludeResto_directory.Make(RPC_encoding)letgen_registerdirservicehandler=registerdirservice(funpqi->Lwt.catch(fun()->handlerpqi)(function|Not_found->RPC_answer.not_found|exn->RPC_answer.fail[Exnexn]))letgen_register=(gen_register:_->_->(_->_->_->_RPC_answer.tLwt.t)->_:>_->_->(_->_->_->[<_RPC_answer.t]Lwt.t)->_)letregisterdirservicehandler=gen_registerdirservice(funpqi->letopenLwt_syntaxinlet*r=handlerpqiinmatchrwithOko->RPC_answer.returno|Errore->RPC_answer.faile)letregister_chunkeddirservicehandler=gen_registerdirservice(funpqi->letopenLwt_syntaxinlet*r=handlerpqiinmatchrwith|Oko->RPC_answer.return_chunkedo|Errore->RPC_answer.faile)letopt_registerdirservicehandler=gen_registerdirservice(funpqi->letopenLwt_syntaxinlet*ro=handlerpqiinmatchrowith|Ok(Someo)->RPC_answer.returno|OkNone->RPC_answer.not_found|Errore->RPC_answer.faile)letlwt_registerdirservicehandler=gen_registerdirservice(funpqi->letopenLwt_syntaxinlet*o=handlerpqiinRPC_answer.returno)openCurryletregister0rootsf=registerroots(curryZf)letregister0_chunkedrootsf=register_chunkedroots(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_register1 rootsf=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)