Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
zecale_wait.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.command_context import CommandContext
6 from click import command, argument, Context, pass_context
7 
8 
9 @command()
10 @argument("transaction-id")
11 @pass_context
12 def wait(
13  ctx: Context,
14  transaction_id: str) -> None:
15  """
16  Wait for a dispatcher transaction and print the result.
17  """
18  cmd_ctx: CommandContext = ctx.obj
19 
20  # TODO: Remove some of the verbosity in this command.
21 
22  # Get dispatcher contract information
23  dispatcher_contract = cmd_ctx.get_dispatcher_contract()
24  print(f"dispatcher_contract={dispatcher_contract}")
25 
26  # Retrieve the tx receipt and dump logs
27  tx_receipt = cmd_ctx.get_web3().eth.waitForTransactionReceipt(
28  transaction_id, 10000)
29 
30  gas_used = tx_receipt.gasUsed
31  status = tx_receipt.status
32  print(f"(gasUsed={gas_used}, status={status})")
33  print(f"tx_receipt={tx_receipt}")
34 
35  # This is kept for convenience during contract development. It can be
36  # removed once the contract code is stable.
37  dispatcher_contract.dump_logs(tx_receipt)
zecale.cli.zecale_wait.wait
None wait(Context ctx, str transaction_id)
Definition: zecale_wait.py:12
zecale.cli.command_context
Definition: command_context.py:1