Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
zecale_get_batch.py
Go to the documentation of this file.
1 # Copyright (c) 2015-2022 Clearmatics Technologies Ltd
2 #
3 # SPDX-License-Identifier: LGPL-3.0+
4 
5 from zecale.cli.defaults import BATCH_PROOF_FILENAME_DEFAULT
6 from zecale.cli.command_context import CommandContext
7 import json
8 from click import option, command, pass_context, Context
9 
10 
11 @command()
12 @option("--name", required=True, help="Target application name")
13 @option(
14  "--batch-file",
15  default=BATCH_PROOF_FILENAME_DEFAULT,
16  help="Batch proof output file")
17 @pass_context
19  ctx: Context,
20  name: str,
21  batch_file: str) -> None:
22  """
23  Request an aggregated transaction for the given application name.
24  """
25 
26  cmd_ctx: CommandContext = ctx.obj
27  wrapper_snark = cmd_ctx.get_wrapper_snark()
28  aggregator_client = cmd_ctx.get_aggregator_client()
29  aggregated_tx = aggregator_client.get_aggregated_transaction(
30  wrapper_snark, name)
31  with open(batch_file, "w") as batch_f:
32  json.dump(aggregated_tx.to_json_dict(), batch_f)
zecale.cli.defaults
Definition: defaults.py:1
zecale.cli.zecale_get_batch.get_batch
None get_batch(Context ctx, str name, str batch_file)
Definition: zecale_get_batch.py:18
zecale.cli.command_context
Definition: command_context.py:1