123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384(*****************************************************************************)(* *)(* 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. *)(* *)(*****************************************************************************)openProtocolmoduleCommands=Client_proto_commandsletcommands:Protocol_client_context.fullTezos_clic.commandlist=letopenTezos_clicinletopenClient_proto_argsinletgroup={name="Demo_counter";title="Commands for protocol Demo_counter"}in[command~group~desc:"Bake a block"no_options(prefixes["bake"]@@msg_param~name:"message"~desc:"message in block header"@@stop)(fun()msgcctxt->Commands.bakecctxtmsg);command~group~desc:"Increment A"no_options(fixed["increment";"a"])(fun()cctxt->Commands.inject_opcctxtProto_operation.IncrA);command~group~desc:"Increment B"no_options(fixed["increment";"b"])(fun()cctxt->Commands.inject_opcctxtProto_operation.IncrB);command~group~desc:"Transfer from A to B"no_options(prefixes["transfer"]@@amount_param~name:"amount"~desc:"amount taken from A and given to B (possibly negative)"@@stop)(fun()amountcctxt->Commands.inject_opcctxt(Proto_operation.Transferamount));command~group~desc:"Get A counter"no_options(fixed["get";"a"])(fun()cctxt->Commands.get_countercctxt`A);command~group~desc:"Get B counter"no_options(fixed["get";"b"])(fun()cctxt->Commands.get_countercctxt`B);]let()=letf=Tezos_clic.map_command(newProtocol_client_context.wrap_full)inletcommand_list=List.mapfcommandsinClient_commands.registerProtocol.hash(fun_network->command_list)