Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
nested_transaction.hpp
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 #ifndef __ZECALE_CORE_NESTED_TRANSACTION_HPP__
6 #define __ZECALE_CORE_NESTED_TRANSACTION_HPP__
7 
8 #include <array>
9 #include <libzeth/core/extended_proof.hpp>
10 
11 namespace libzecale
12 {
13 
17 template<typename nppT, typename nsnarkT> class nested_transaction
18 {
19 private:
20  std::string _application_name;
21  std::shared_ptr<libzeth::extended_proof<nppT, nsnarkT>> _extended_proof;
22  std::vector<uint8_t> _parameters;
23  uint32_t _fee_wei;
24 
25 public:
26  // TODO: explicitly delete this to remove the possibility of undefined
27  // object.
29 
30  // TODO: support move semantics for application_name, parameters and
31  // extended_proof.
33  const std::string &application_name,
34  const libzeth::extended_proof<nppT, nsnarkT> &extended_proof,
35  const std::vector<uint8_t> &parameters,
36  uint32_t fee_wei = 0);
37 
38  const std::string &application_name() const;
39 
40  const libzeth::extended_proof<nppT, nsnarkT> &extended_proof() const;
41 
42  const std::vector<uint8_t> &parameters() const;
43 
44  uint32_t fee_wei() const;
45 
46  std::ostream &write_json(std::ostream &) const;
47 
50  bool operator<(const nested_transaction<nppT, nsnarkT> &right) const;
51 };
52 
53 } // namespace libzecale
54 
56 
57 #endif // __ZECALE_CORE_NESTED_TRANSACTION_HPP__
libzecale::nested_transaction::fee_wei
uint32_t fee_wei() const
libzecale::nested_transaction
Definition: nested_transaction.hpp:17
libzecale::nested_transaction::nested_transaction
nested_transaction()
nested_transaction.tcc
libzecale::nested_transaction::extended_proof
const libzeth::extended_proof< nppT, nsnarkT > & extended_proof() const
libzecale::nested_transaction::operator<
bool operator<(const nested_transaction< nppT, nsnarkT > &right) const
libzecale
Definition: aggregator_circuit.hpp:15
libzecale::nested_transaction::write_json
std::ostream & write_json(std::ostream &) const
libzecale::nested_transaction::parameters
const std::vector< uint8_t > & parameters() const
libzecale::nested_transaction::application_name
const std::string & application_name() const