Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
Functions | Variables
zecale.dummy_app.get Namespace Reference

Functions

None get (Context ctx, int scalar, str instance_file, Optional[int] check)
 

Variables

 type
 
 default
 
 help
 
 int
 

Function Documentation

◆ get()

None zecale.dummy_app.get.get ( Context  ctx,
int  scalar,
str  instance_file,
Optional[int check 
)
Query the deployed contract to find the value stored for a given scalar.
(These values are the parameters submitted along side the proof for the
given scalar.)

Definition at line 22 of file get.py.

22 def get(
23  ctx: Context,
24  scalar: int,
25  instance_file: str,
26  check: Optional[int]) -> None:
27  """
28  Query the deployed contract to find the value stored for a given scalar.
29  (These values are the parameters submitted along side the proof for the
30  given scalar.)
31  """
32 
33  eth_network = ctx.obj["eth_network"]
34 
35  # Load the contract instance
36  with open(instance_file, "r") as instance_f:
37  instance_desc = InstanceDescription.from_json_dict(json.load(instance_f))
38 
39  # Instantiate
40  web3 = open_web3_from_network(eth_network)
41  app_contract = instance_desc.instantiate(web3)
42  result: int = app_contract.functions.get(scalar).call()
43  print(f"{scalar}: {result}")
44 
45  if (check is not None) and (result != check):
46  raise ClickException("state check failed")

Variable Documentation

◆ default

zecale.dummy_app.get.default

Definition at line 17 of file get.py.

◆ help

zecale.dummy_app.get.help

Definition at line 18 of file get.py.

◆ int

zecale.dummy_app.get.int

Definition at line 20 of file get.py.

◆ type

zecale.dummy_app.get.type

Definition at line 14 of file get.py.

zecale.dummy_app.get.get
None get(Context ctx, int scalar, str instance_file, Optional[int] check)
Definition: get.py:22