|
| Tuple[DispatcherContract, InstanceDescription] | deploy (Any web3, IZKSnarkProvider zksnark, PairingParameters pp, IVerificationKey vk, str eth_addr, Optional[bytes] eth_private_key) |
| |
Wrapper around operations on the zecale dispatcher contract.
Definition at line 23 of file dispatcher_contract.py.
◆ __init__()
| def zecale.core.dispatcher_contract.DispatcherContract.__init__ |
( |
|
self, |
|
|
Any |
web3, |
|
|
InstanceDescription |
instance_desc, |
|
|
IZKSnarkProvider |
zksnark |
|
) |
| |
Definition at line 28 of file dispatcher_contract.py.
31 instance_desc: InstanceDescription,
32 zksnark: IZKSnarkProvider):
34 self.instance = instance_desc.instantiate(web3)
35 self.zksnark = zksnark
◆ deploy()
| Tuple[DispatcherContract, InstanceDescription] zecale.core.dispatcher_contract.DispatcherContract.deploy |
( |
Any |
web3, |
|
|
IZKSnarkProvider |
zksnark, |
|
|
PairingParameters |
pp, |
|
|
IVerificationKey |
vk, |
|
|
str |
eth_addr, |
|
|
Optional[bytes]
|
eth_private_key |
|
) |
| |
|
static |
Deploy the contract, returning an instance of this wrapper, and a
description (which can be saved to a file to later instantiate).
Definition at line 38 of file dispatcher_contract.py.
40 zksnark: IZKSnarkProvider,
41 pp: PairingParameters,
44 eth_private_key: Optional[bytes]
45 ) -> Tuple[DispatcherContract, InstanceDescription]:
47 Deploy the contract, returning an instance of this wrapper, and a
48 description (which can be saved to a file to later instantiate).
50 vk_evm = zksnark.verification_key_to_contract_parameters(vk, pp)
51 instance_desc = InstanceDescription.deploy(
53 DISPATCHER_SOURCE_FILE,
57 DISPATCHER_DEPLOY_GAS,
58 {
"allow_paths": CONTRACTS_DIR},
60 return DispatcherContract(web3, instance_desc, zksnark), instance_desc
◆ dump_logs()
| None zecale.core.dispatcher_contract.DispatcherContract.dump_logs |
( |
|
self, |
|
|
Any |
tx_receipt |
|
) |
| |
Print out debug log information from a dispatcher invocation
Definition at line 96 of file dispatcher_contract.py.
96 def dump_logs(self, tx_receipt: Any) ->
None:
98 Print out debug log information from a dispatcher invocation
100 logs = get_event_logs_from_tx_receipt(self.instance,
"log", tx_receipt)
101 for event_data
in logs:
102 print(f
"{event_data.args['a']}: {event_data.args['v']}")
◆ process_batch()
| bytes zecale.core.dispatcher_contract.DispatcherContract.process_batch |
( |
|
self, |
|
|
PairingParameters |
pp, |
|
|
AggregatedTransaction |
batch, |
|
|
str |
application_contract_address, |
|
|
str |
eth_addr, |
|
|
Optional[bytes] |
eth_private_key |
|
) |
| |
Send a batch to the contracts process_batch entry point. Returns the
transaction ID.
Definition at line 62 of file dispatcher_contract.py.
64 pp: PairingParameters,
65 batch: AggregatedTransaction,
66 application_contract_address: str,
68 eth_private_key: Optional[bytes]) -> bytes:
70 Send a batch to the contracts process_batch entry point. Returns the
77 proof_evm = self.zksnark.proof_to_contract_parameters(
78 batch.ext_proof.proof, pp)
79 inputs_evm = hex_list_to_uint256_list(batch.ext_proof.inputs)
81 contract_call = self.instance.functions.process_batch(
84 batch.nested_parameters,
85 application_contract_address)
88 return send_contract_call(
◆ instance
| zecale.core.dispatcher_contract.DispatcherContract.instance |
◆ web3
| zecale.core.dispatcher_contract.DispatcherContract.web3 |
◆ zksnark
| zecale.core.dispatcher_contract.DispatcherContract.zksnark |
The documentation for this class was generated from the following file: