123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958(*****************************************************************************)(* *)(* 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. *)(* *)(*****************************************************************************)openAlpha_contextopenData_encodingleterror_encoding=def"error"~description:"The full list of RPC errors would be too long to include.\n\
It is available at RPC `/errors` (GET).\n\
Errors specific to protocol Alpha have an id that starts with `proto.alpha`."@@splitted~json:(conv(funerr->Data_encoding.Json.constructError_monad.error_encodingerr)(funjson->Data_encoding.Json.destructError_monad.error_encodingjson)json)~binary:Error_monad.error_encodingtype_successful_manager_operation_result=|Reveal_result:Kind.revealsuccessful_manager_operation_result|Transaction_result:{storage:Script.exproption;big_map_diff:Contract.big_map_diffoption;balance_updates:Delegate.balance_updates;originated_contracts:Contract.tlist;consumed_gas:Z.t;storage_size:Z.t;paid_storage_size_diff:Z.t;}->Kind.transactionsuccessful_manager_operation_result|Origination_result:{balance_updates:Delegate.balance_updates;originated_contracts:Contract.tlist;consumed_gas:Z.t;storage_size:Z.t;paid_storage_size_diff:Z.t;}->Kind.originationsuccessful_manager_operation_result|Delegation_result:Kind.delegationsuccessful_manager_operation_resulttypepacked_successful_manager_operation_result=|Successful_manager_result:'kindsuccessful_manager_operation_result->packed_successful_manager_operation_resulttype'kindmanager_operation_result=|Appliedof'kindsuccessful_manager_operation_result|Backtrackedof'kindsuccessful_manager_operation_result*errorlistoption|Failed:'kindKind.manager*errorlist->'kindmanager_operation_result|Skipped:'kindKind.manager->'kindmanager_operation_resulttypepacked_internal_operation_result=|Internal_operation_result:'kindinternal_operation*'kindmanager_operation_result->packed_internal_operation_resultmoduleManager_result=structtype'kindcase=MCase:{op_case:'kindOperation.Encoding.Manager_operations.case;encoding:'aData_encoding.t;kind:'kindKind.manager;iselect:packed_internal_operation_result->('kindinternal_operation*'kindmanager_operation_result)option;select:packed_successful_manager_operation_result->'kindsuccessful_manager_operation_resultoption;proj:'kindsuccessful_manager_operation_result->'a;inj:'a->'kindsuccessful_manager_operation_result;t:'kindmanager_operation_resultData_encoding.t;}->'kindcaseletmake~op_case~encoding~kind~iselect~select~proj~inj=letOperation.Encoding.Manager_operations.MCase{name;_}=op_caseinlett=def(Format.asprintf"operation.alpha.operation_result.%s"name)@@union~tag_size:`Uint8[case(Tag0)~title:"Applied"(merge_objs(obj1(req"status"(constant"applied")))encoding)(funo->matchowith|Skipped_|Failed_|Backtracked_->None|Appliedo->matchselect(Successful_manager_resulto)with|None->None|Someo->Some((),projo))(fun((),x)->(Applied(injx)));case(Tag1)~title:"Failed"(obj2(req"status"(constant"failed"))(req"errors"(listerror_encoding)))(function(Failed(_,errs))->Some((),errs)|_->None)(fun((),errs)->Failed(kind,errs));case(Tag2)~title:"Skipped"(obj1(req"status"(constant"skipped")))(functionSkipped_->Some()|_->None)(fun()->Skippedkind);case(Tag3)~title:"Backtracked"(merge_objs(obj2(req"status"(constant"backtracked"))(opt"errors"(listerror_encoding)))encoding)(funo->matchowith|Skipped_|Failed_|Applied_->None|Backtracked(o,errs)->matchselect(Successful_manager_resulto)with|None->None|Someo->Some(((),errs),projo))(fun(((),errs),x)->(Backtracked(injx,errs)));]inMCase{op_case;encoding;kind;iselect;select;proj;inj;t}letreveal_case=make~op_case:Operation.Encoding.Manager_operations.reveal_case~encoding:Data_encoding.empty~iselect:(function|Internal_operation_result({operation=Reveal_;_}asop,res)->Some(op,res)|_->None)~select:(function|Successful_manager_result(Reveal_resultasop)->Someop|_->None)~kind:Kind.Reveal_manager_kind~proj:(functionReveal_result->())~inj:(fun()->Reveal_result)lettransaction_case=make~op_case:Operation.Encoding.Manager_operations.transaction_case~encoding:(obj7(opt"storage"Script.expr_encoding)(opt"big_map_diff"Contract.big_map_diff_encoding)(dft"balance_updates"Delegate.balance_updates_encoding[])(dft"originated_contracts"(listContract.encoding)[])(dft"consumed_gas"zZ.zero)(dft"storage_size"zZ.zero)(dft"paid_storage_size_diff"zZ.zero))~iselect:(function|Internal_operation_result({operation=Transaction_;_}asop,res)->Some(op,res)|_->None)~select:(function|Successful_manager_result(Transaction_result_asop)->Someop|_->None)~kind:Kind.Transaction_manager_kind~proj:(function|Transaction_result{storage;big_map_diff;balance_updates;originated_contracts;consumed_gas;storage_size;paid_storage_size_diff}->(storage,big_map_diff,balance_updates,originated_contracts,consumed_gas,storage_size,paid_storage_size_diff))~inj:(fun(storage,big_map_diff,balance_updates,originated_contracts,consumed_gas,storage_size,paid_storage_size_diff)->Transaction_result{storage;big_map_diff;balance_updates;originated_contracts;consumed_gas;storage_size;paid_storage_size_diff})letorigination_case=make~op_case:Operation.Encoding.Manager_operations.origination_case~encoding:(obj5(dft"balance_updates"Delegate.balance_updates_encoding[])(dft"originated_contracts"(listContract.encoding)[])(dft"consumed_gas"zZ.zero)(dft"storage_size"zZ.zero)(dft"paid_storage_size_diff"zZ.zero))~iselect:(function|Internal_operation_result({operation=Origination_;_}asop,res)->Some(op,res)|_->None)~select:(function|Successful_manager_result(Origination_result_asop)->Someop|_->None)~proj:(function|Origination_result{balance_updates;originated_contracts;consumed_gas;storage_size;paid_storage_size_diff}->(balance_updates,originated_contracts,consumed_gas,storage_size,paid_storage_size_diff))~kind:Kind.Origination_manager_kind~inj:(fun(balance_updates,originated_contracts,consumed_gas,storage_size,paid_storage_size_diff)->Origination_result{balance_updates;originated_contracts;consumed_gas;storage_size;paid_storage_size_diff})letdelegation_case=make~op_case:Operation.Encoding.Manager_operations.delegation_case~encoding:Data_encoding.empty~iselect:(function|Internal_operation_result({operation=Delegation_;_}asop,res)->Some(op,res)|_->None)~select:(function|Successful_manager_result(Delegation_resultasop)->Someop|_->None)~kind:Kind.Delegation_manager_kind~proj:(functionDelegation_result->())~inj:(fun()->Delegation_result)endletinternal_operation_result_encoding:packed_internal_operation_resultData_encoding.t=letmake(typekind)(Manager_result.MCaseres_case:kindManager_result.case)=letOperation.Encoding.Manager_operations.MCaseop_case=res_case.op_caseincase(Tagop_case.tag)~title:op_case.name(merge_objs(obj3(req"kind"(constantop_case.name))(req"source"Contract.encoding)(req"nonce"uint16))(merge_objsop_case.encoding(obj1(req"result"res_case.t))))(funop->matchres_case.iselectopwith|Some(op,res)->Some(((),op.source,op.nonce),(op_case.projop.operation,res))|None->None)(fun(((),source,nonce),(op,res))->letop={source;operation=op_case.injop;nonce}inInternal_operation_result(op,res))indef"operation.alpha.internal_operation_result"@@union[makeManager_result.reveal_case;makeManager_result.transaction_case;makeManager_result.origination_case;makeManager_result.delegation_case;]type'kindcontents_result=|Endorsement_result:{balance_updates:Delegate.balance_updates;delegate:Signature.Public_key_hash.t;slots:intlist;}->Kind.endorsementcontents_result|Seed_nonce_revelation_result:Delegate.balance_updates->Kind.seed_nonce_revelationcontents_result|Double_endorsement_evidence_result:Delegate.balance_updates->Kind.double_endorsement_evidencecontents_result|Double_baking_evidence_result:Delegate.balance_updates->Kind.double_baking_evidencecontents_result|Activate_account_result:Delegate.balance_updates->Kind.activate_accountcontents_result|Proposals_result:Kind.proposalscontents_result|Ballot_result:Kind.ballotcontents_result|Manager_operation_result:{balance_updates:Delegate.balance_updates;operation_result:'kindmanager_operation_result;internal_operation_results:packed_internal_operation_resultlist;}->'kindKind.managercontents_resulttypepacked_contents_result=|Contents_result:'kindcontents_result->packed_contents_resulttypepacked_contents_and_result=|Contents_and_result:'kindOperation.contents*'kindcontents_result->packed_contents_and_resulttype('a,'b)eq=Eq:('a,'a)eqletequal_manager_kind:typeab.aKind.manager->bKind.manager->(a,b)eqoption=funkakb->matchka,kbwith|Kind.Reveal_manager_kind,Kind.Reveal_manager_kind->SomeEq|Kind.Reveal_manager_kind,_->None|Kind.Transaction_manager_kind,Kind.Transaction_manager_kind->SomeEq|Kind.Transaction_manager_kind,_->None|Kind.Origination_manager_kind,Kind.Origination_manager_kind->SomeEq|Kind.Origination_manager_kind,_->None|Kind.Delegation_manager_kind,Kind.Delegation_manager_kind->SomeEq|Kind.Delegation_manager_kind,_->NonemoduleEncoding=structtype'kindcase=Case:{op_case:'kindOperation.Encoding.case;encoding:'aData_encoding.t;select:packed_contents_result->'kindcontents_resultoption;mselect:packed_contents_and_result->('kindcontents*'kindcontents_result)option;proj:'kindcontents_result->'a;inj:'a->'kindcontents_result;}->'kindcaselettagged_casetagnameargsprojinj=letopenData_encodingincasetag~title:(String.capitalize_asciiname)(merge_objs(obj1(req"kind"(constantname)))args)(funx->matchprojxwithNone->None|Somex->Some((),x))(fun((),x)->injx)letendorsement_case=Case{op_case=Operation.Encoding.endorsement_case;encoding=(obj3(req"balance_updates"Delegate.balance_updates_encoding)(req"delegate"Signature.Public_key_hash.encoding)(req"slots"(listuint8)));select=(function|Contents_result(Endorsement_result_asop)->Someop|_->None);mselect=(function|Contents_and_result(Endorsement_asop,res)->Some(op,res)|_->None);proj=(function|Endorsement_result{balance_updates;delegate;slots}->(balance_updates,delegate,slots));inj=(fun(balance_updates,delegate,slots)->Endorsement_result{balance_updates;delegate;slots})}letseed_nonce_revelation_case=Case{op_case=Operation.Encoding.seed_nonce_revelation_case;encoding=(obj1(req"balance_updates"Delegate.balance_updates_encoding));select=(function|Contents_result(Seed_nonce_revelation_result_asop)->Someop|_->None);mselect=(function|Contents_and_result(Seed_nonce_revelation_asop,res)->Some(op,res)|_->None);proj=(fun(Seed_nonce_revelation_resultbus)->bus);inj=(funbus->Seed_nonce_revelation_resultbus);}letdouble_endorsement_evidence_case=Case{op_case=Operation.Encoding.double_endorsement_evidence_case;encoding=(obj1(req"balance_updates"Delegate.balance_updates_encoding));select=(function|Contents_result(Double_endorsement_evidence_result_asop)->Someop|_->None);mselect=(function|Contents_and_result(Double_endorsement_evidence_asop,res)->Some(op,res)|_->None);proj=(fun(Double_endorsement_evidence_resultbus)->bus);inj=(funbus->Double_endorsement_evidence_resultbus)}letdouble_baking_evidence_case=Case{op_case=Operation.Encoding.double_baking_evidence_case;encoding=(obj1(req"balance_updates"Delegate.balance_updates_encoding));select=(function|Contents_result(Double_baking_evidence_result_asop)->Someop|_->None);mselect=(function|Contents_and_result(Double_baking_evidence_asop,res)->Some(op,res)|_->None);proj=(fun(Double_baking_evidence_resultbus)->bus);inj=(funbus->Double_baking_evidence_resultbus);}letactivate_account_case=Case{op_case=Operation.Encoding.activate_account_case;encoding=(obj1(req"balance_updates"Delegate.balance_updates_encoding));select=(function|Contents_result(Activate_account_result_asop)->Someop|_->None);mselect=(function|Contents_and_result(Activate_account_asop,res)->Some(op,res)|_->None);proj=(fun(Activate_account_resultbus)->bus);inj=(funbus->Activate_account_resultbus);}letproposals_case=Case{op_case=Operation.Encoding.proposals_case;encoding=Data_encoding.empty;select=(function|Contents_result(Proposals_resultasop)->Someop|_->None);mselect=(function|Contents_and_result(Proposals_asop,res)->Some(op,res)|_->None);proj=(funProposals_result->());inj=(fun()->Proposals_result);}letballot_case=Case{op_case=Operation.Encoding.ballot_case;encoding=Data_encoding.empty;select=(function|Contents_result(Ballot_resultasop)->Someop|_->None);mselect=(function|Contents_and_result(Ballot_asop,res)->Some(op,res)|_->None);proj=(funBallot_result->());inj=(fun()->Ballot_result);}letmake_manager_case(typekind)(Operation.Encoding.Caseop_case:kindKind.managerOperation.Encoding.case)(Manager_result.MCaseres_case:kindManager_result.case)mselect=Case{op_case=Operation.Encoding.Caseop_case;encoding=(obj3(req"balance_updates"Delegate.balance_updates_encoding)(req"operation_result"res_case.t)(dft"internal_operation_results"(listinternal_operation_result_encoding)[]));select=(function|Contents_result(Manager_operation_result({operation_result=Appliedres;_}asop))->beginmatchres_case.select(Successful_manager_resultres)with|Someres->Some(Manager_operation_result{opwithoperation_result=Appliedres})|None->Noneend|Contents_result(Manager_operation_result({operation_result=Backtracked(res,errs);_}asop))->beginmatchres_case.select(Successful_manager_resultres)with|Someres->Some(Manager_operation_result{opwithoperation_result=Backtracked(res,errs)})|None->Noneend|Contents_result(Manager_operation_result({operation_result=Skippedkind;_}asop))->beginmatchequal_manager_kindkindres_case.kindwith|None->None|SomeEq->Some(Manager_operation_result{opwithoperation_result=Skippedkind})end|Contents_result(Manager_operation_result({operation_result=Failed(kind,errs);_}asop))->beginmatchequal_manager_kindkindres_case.kindwith|None->None|SomeEq->Some(Manager_operation_result{opwithoperation_result=Failed(kind,errs)})end|Contents_resultBallot_result->None|Contents_result(Endorsement_result_)->None|Contents_result(Seed_nonce_revelation_result_)->None|Contents_result(Double_endorsement_evidence_result_)->None|Contents_result(Double_baking_evidence_result_)->None|Contents_result(Activate_account_result_)->None|Contents_resultProposals_result->None);mselect;proj=(fun(Manager_operation_result{balance_updates=bus;operation_result=r;internal_operation_results=rs})->(bus,r,rs));inj=(fun(bus,r,rs)->Manager_operation_result{balance_updates=bus;operation_result=r;internal_operation_results=rs});}letreveal_case=make_manager_caseOperation.Encoding.reveal_caseManager_result.reveal_case(function|Contents_and_result(Manager_operation{operation=Reveal_;_}asop,res)->Some(op,res)|_->None)lettransaction_case=make_manager_caseOperation.Encoding.transaction_caseManager_result.transaction_case(function|Contents_and_result(Manager_operation{operation=Transaction_;_}asop,res)->Some(op,res)|_->None)letorigination_case=make_manager_caseOperation.Encoding.origination_caseManager_result.origination_case(function|Contents_and_result(Manager_operation{operation=Origination_;_}asop,res)->Some(op,res)|_->None)letdelegation_case=make_manager_caseOperation.Encoding.delegation_caseManager_result.delegation_case(function|Contents_and_result(Manager_operation{operation=Delegation_;_}asop,res)->Some(op,res)|_->None)endletcontents_result_encoding=letopenEncodinginletmake(Case{op_case=Operation.Encoding.Case{tag;name;_};encoding;mselect=_;select;proj;inj})=letprojx=matchselectxwith|None->None|Somex->Some(projx)inletinjx=Contents_result(injx)intagged_case(Tagtag)nameencodingprojinjindef"operation.alpha.contents_result"@@union[makeendorsement_case;makeseed_nonce_revelation_case;makedouble_endorsement_evidence_case;makedouble_baking_evidence_case;makeactivate_account_case;makeproposals_case;makeballot_case;makereveal_case;maketransaction_case;makeorigination_case;makedelegation_case;]letcontents_and_result_encoding=letopenEncodinginletmake(Case{op_case=Operation.Encoding.Case{tag;name;encoding;proj;inj;_};mselect;encoding=meta_encoding;proj=meta_proj;inj=meta_inj;_})=letprojc=matchmselectcwith|Some(op,res)->Some(projop,meta_projres)|_->Noneinletinj(op,res)=Contents_and_result(injop,meta_injres)inletencoding=merge_objsencoding(obj1(req"metadata"meta_encoding))intagged_case(Tagtag)nameencodingprojinjindef"operation.alpha.operation_contents_and_result"@@union[makeendorsement_case;makeseed_nonce_revelation_case;makedouble_endorsement_evidence_case;makedouble_baking_evidence_case;makeactivate_account_case;makeproposals_case;makeballot_case;makereveal_case;maketransaction_case;makeorigination_case;makedelegation_case;]type'kindcontents_result_list=|Single_result:'kindcontents_result->'kindcontents_result_list|Cons_result:'kindKind.managercontents_result*'restKind.managercontents_result_list->(('kind*'rest)Kind.manager)contents_result_listtypepacked_contents_result_list=Contents_result_list:'kindcontents_result_list->packed_contents_result_listletcontents_result_list_encoding=letrecto_list=function|Contents_result_list(Single_resulto)->[Contents_resulto]|Contents_result_list(Cons_result(o,os))->Contents_resulto::to_list(Contents_result_listos)inletrecof_list=function|[]->Pervasives.failwith"cannot decode empty operation result"|[Contents_resulto]->Contents_result_list(Single_resulto)|(Contents_resulto)::os->letContents_result_listos=of_listosinmatcho,oswith|Manager_operation_result_,Single_result(Manager_operation_result_)->Contents_result_list(Cons_result(o,os))|Manager_operation_result_,Cons_result_->Contents_result_list(Cons_result(o,os))|_->Pervasives.failwith"cannot decode ill-formed operation result"indef"operation.alpha.contents_list_result"@@convto_listof_list(listcontents_result_encoding)type'kindcontents_and_result_list=|Single_and_result:'kindAlpha_context.contents*'kindcontents_result->'kindcontents_and_result_list|Cons_and_result:'kindKind.managerAlpha_context.contents*'kindKind.managercontents_result*'restKind.managercontents_and_result_list->('kind*'rest)Kind.managercontents_and_result_listtypepacked_contents_and_result_list=|Contents_and_result_list:'kindcontents_and_result_list->packed_contents_and_result_listletcontents_and_result_list_encoding=letrecto_list=function|Contents_and_result_list(Single_and_result(op,res))->[Contents_and_result(op,res)]|Contents_and_result_list(Cons_and_result(op,res,rest))->Contents_and_result(op,res)::to_list(Contents_and_result_listrest)inletrecof_list=function|[]->Pervasives.failwith"cannot decode empty combined operation result"|[Contents_and_result(op,res)]->Contents_and_result_list(Single_and_result(op,res))|(Contents_and_result(op,res))::rest->letContents_and_result_listrest=of_listrestinmatchop,restwith|Manager_operation_,Single_and_result(Manager_operation_,_)->Contents_and_result_list(Cons_and_result(op,res,rest))|Manager_operation_,Cons_and_result(_,_,_)->Contents_and_result_list(Cons_and_result(op,res,rest))|_->Pervasives.failwith"cannot decode ill-formed combined operation result"inconvto_listof_list(Variable.listcontents_and_result_encoding)type'kindoperation_metadata={contents:'kindcontents_result_list;}typepacked_operation_metadata=|Operation_metadata:'kindoperation_metadata->packed_operation_metadata|No_operation_metadata:packed_operation_metadataletoperation_metadata_encoding=def"operation.alpha.result"@@union[case(Tag0)~title:"Operation_metadata"contents_result_list_encoding(function|Operation_metadata{contents}->Some(Contents_result_listcontents)|_->None)(fun(Contents_result_listcontents)->Operation_metadata{contents});case(Tag1)~title:"No_operation_metadata"empty(function|No_operation_metadata->Some()|_->None)(fun()->No_operation_metadata);]letkind_equal:typekindkind2.kindcontents->kind2contents_result->(kind,kind2)eqoption=funopres->matchop,reswith|Endorsement_,Endorsement_result_->SomeEq|Endorsement_,_->None|Seed_nonce_revelation_,Seed_nonce_revelation_result_->SomeEq|Seed_nonce_revelation_,_->None|Double_endorsement_evidence_,Double_endorsement_evidence_result_->SomeEq|Double_endorsement_evidence_,_->None|Double_baking_evidence_,Double_baking_evidence_result_->SomeEq|Double_baking_evidence_,_->None|Activate_account_,Activate_account_result_->SomeEq|Activate_account_,_->None|Proposals_,Proposals_result->SomeEq|Proposals_,_->None|Ballot_,Ballot_result->SomeEq|Ballot_,_->None|Manager_operation{operation=Reveal_;_},Manager_operation_result{operation_result=AppliedReveal_result;_}->SomeEq|Manager_operation{operation=Reveal_;_},Manager_operation_result{operation_result=Backtracked(Reveal_result,_);_}->SomeEq|Manager_operation{operation=Reveal_;_},Manager_operation_result{operation_result=Failed(Alpha_context.Kind.Reveal_manager_kind,_);_}->SomeEq|Manager_operation{operation=Reveal_;_},Manager_operation_result{operation_result=Skipped(Alpha_context.Kind.Reveal_manager_kind);_}->SomeEq|Manager_operation{operation=Reveal_;_},_->None|Manager_operation{operation=Transaction_;_},Manager_operation_result{operation_result=Applied(Transaction_result_);_}->SomeEq|Manager_operation{operation=Transaction_;_},Manager_operation_result{operation_result=Backtracked(Transaction_result_,_);_}->SomeEq|Manager_operation{operation=Transaction_;_},Manager_operation_result{operation_result=Failed(Alpha_context.Kind.Transaction_manager_kind,_);_}->SomeEq|Manager_operation{operation=Transaction_;_},Manager_operation_result{operation_result=Skipped(Alpha_context.Kind.Transaction_manager_kind);_}->SomeEq|Manager_operation{operation=Transaction_;_},_->None|Manager_operation{operation=Origination_;_},Manager_operation_result{operation_result=Applied(Origination_result_);_}->SomeEq|Manager_operation{operation=Origination_;_},Manager_operation_result{operation_result=Backtracked(Origination_result_,_);_}->SomeEq|Manager_operation{operation=Origination_;_},Manager_operation_result{operation_result=Failed(Alpha_context.Kind.Origination_manager_kind,_);_}->SomeEq|Manager_operation{operation=Origination_;_},Manager_operation_result{operation_result=Skipped(Alpha_context.Kind.Origination_manager_kind);_}->SomeEq|Manager_operation{operation=Origination_;_},_->None|Manager_operation{operation=Delegation_;_},Manager_operation_result{operation_result=AppliedDelegation_result;_}->SomeEq|Manager_operation{operation=Delegation_;_},Manager_operation_result{operation_result=Backtracked(Delegation_result,_);_}->SomeEq|Manager_operation{operation=Delegation_;_},Manager_operation_result{operation_result=Failed(Alpha_context.Kind.Delegation_manager_kind,_);_}->SomeEq|Manager_operation{operation=Delegation_;_},Manager_operation_result{operation_result=Skipped(Alpha_context.Kind.Delegation_manager_kind);_}->SomeEq|Manager_operation{operation=Delegation_;_},_->Noneletreckind_equal_list:typekindkind2.kindcontents_list->kind2contents_result_list->(kind,kind2)eqoption=funcontentsres->matchcontents,reswith|Singleop,Single_resultres->beginmatchkind_equalopreswith|None->None|SomeEq->SomeEqend|Cons(op,ops),Cons_result(res,ress)->beginmatchkind_equalopreswith|None->None|SomeEq->matchkind_equal_listopsresswith|None->None|SomeEq->SomeEqend|_->Noneletrecpack_contents_list:typekind.kindcontents_list->kindcontents_result_list->kindcontents_and_result_list=funcontentsres->beginmatchcontents,reswith|Singleop,Single_resultres->Single_and_result(op,res)|Cons(op,ops),Cons_result(res,ress)->Cons_and_result(op,res,pack_contents_listopsress)|Single(Manager_operation_),Cons_result(Manager_operation_result_,Single_result_)->.|Cons(_,_),Single_result(Manager_operation_result{operation_result=Failed_;_})->.|Cons(_,_),Single_result(Manager_operation_result{operation_result=Skipped_;_})->.|Cons(_,_),Single_result(Manager_operation_result{operation_result=Applied_;_})->.|Cons(_,_),Single_result(Manager_operation_result{operation_result=Backtracked_;_})->.|Single_,Cons_result_->.endletrecunpack_contents_list:typekind.kindcontents_and_result_list->(kindcontents_list*kindcontents_result_list)=function|Single_and_result(op,res)->Singleop,Single_resultres|Cons_and_result(op,res,rest)->letops,ress=unpack_contents_listrestinCons(op,ops),Cons_result(res,ress)letoperation_data_and_metadata_encoding=def"operation.alpha.operation_with_metadata"@@union[case(Tag0)~title:"Operation_with_metadata"(obj2(req"contents"(dynamic_sizecontents_and_result_list_encoding))(opt"signature"Signature.encoding))(function|(Operation_data_,No_operation_metadata)->None|(Operation_dataop,Operation_metadatares)->matchkind_equal_listop.contentsres.contentswith|None->Pervasives.failwith"cannot decode inconsistent combined operation result"|SomeEq->Some(Contents_and_result_list(pack_contents_listop.contentsres.contents),op.signature))(fun(Contents_and_result_listcontents,signature)->letop_contents,res_contents=unpack_contents_listcontentsin(Operation_data{contents=op_contents;signature},Operation_metadata{contents=res_contents}));case(Tag1)~title:"Operation_without_metadata"(obj2(req"contents"(dynamic_sizeOperation.contents_list_encoding))(opt"signature"Signature.encoding))(function|(Operation_dataop,No_operation_metadata)->Some(Contents_listop.contents,op.signature)|(Operation_data_,Operation_metadata_)->None)(fun(Contents_listcontents,signature)->(Operation_data{contents;signature},No_operation_metadata))]typeblock_metadata={baker:Signature.Public_key_hash.t;level:Level.t;voting_period_kind:Voting_period.kind;nonce_hash:Nonce_hash.toption;consumed_gas:Z.t;deactivated:Signature.Public_key_hash.tlist;balance_updates:Delegate.balance_updates;}letblock_metadata_encoding=letopenData_encodingindef"block_header.alpha.metadata"@@conv(fun{baker;level;voting_period_kind;nonce_hash;consumed_gas;deactivated;balance_updates}->(baker,level,voting_period_kind,nonce_hash,consumed_gas,deactivated,balance_updates))(fun(baker,level,voting_period_kind,nonce_hash,consumed_gas,deactivated,balance_updates)->{baker;level;voting_period_kind;nonce_hash;consumed_gas;deactivated;balance_updates})(obj7(req"baker"Signature.Public_key_hash.encoding)(req"level"Level.encoding)(req"voting_period_kind"Voting_period.kind_encoding)(req"nonce_hash"(optionNonce_hash.encoding))(req"consumed_gas"(check_size10n))(req"deactivated"(listSignature.Public_key_hash.encoding))(req"balance_updates"Delegate.balance_updates_encoding))