Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
aggregated_transaction.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 __future__ import annotations
6 from zeth.core.zksnark import IZKSnarkProvider, ExtendedProof
7 from typing import Dict, List, Any
8 
9 
11  """
12  An aggregated transaction, returned by the aggregator server.
13  """
14  def __init__(
15  self,
16  app_name: str,
17  ext_proof: ExtendedProof,
18  nested_parameters: List[bytes]):
19  self.app_name = app_name
20  self.ext_proof = ext_proof
21  self.nested_parameters = nested_parameters
22 
23  @staticmethod
25  zksnark: IZKSnarkProvider,
26  json_dict: Dict[str, Any]) -> AggregatedTransaction:
27  app_name = json_dict["app_name"]
28  ext_proof = ExtendedProof.from_json_dict(zksnark, json_dict["ext_proof"])
29  nested_parameters = \
30  [bytes.fromhex(x) for x in json_dict["nested_parameters"]]
31  return AggregatedTransaction(app_name, ext_proof, nested_parameters)
32 
33  def to_json_dict(self) -> Dict[str, Any]:
34  return {
35  "app_name": self.app_name,
36  "ext_proof": self.ext_proof.to_json_dict(),
37  "nested_parameters": [x.hex() for x in self.nested_parameters],
38  }
zecale.core.aggregated_transaction.AggregatedTransaction.__init__
def __init__(self, str app_name, ExtendedProof ext_proof, List[bytes] nested_parameters)
Definition: aggregated_transaction.py:14
zecale.core.aggregated_transaction.AggregatedTransaction.app_name
app_name
Definition: aggregated_transaction.py:15
zecale.core.aggregated_transaction.AggregatedTransaction
Definition: aggregated_transaction.py:10
zecale.core.aggregated_transaction.AggregatedTransaction.nested_parameters
nested_parameters
Definition: aggregated_transaction.py:17
zecale.core.aggregated_transaction.AggregatedTransaction.ext_proof
ext_proof
Definition: aggregated_transaction.py:16
zecale.core.aggregated_transaction.AggregatedTransaction.to_json_dict
Dict[str, Any] to_json_dict(self)
Definition: aggregated_transaction.py:33
zecale.core.aggregated_transaction.AggregatedTransaction.from_json_dict
AggregatedTransaction from_json_dict(IZKSnarkProvider zksnark, Dict[str, Any] json_dict)
Definition: aggregated_transaction.py:24