2024-10-10 14:09:31 +03:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
2024-10-14 13:12:59 +03:00
|
|
|
use crate::merkle_tree_public::TreeHashType;
|
2024-10-10 14:09:31 +03:00
|
|
|
|
2024-11-28 22:05:14 +02:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
|
|
|
|
|
pub enum TxKind {
|
|
|
|
|
Public,
|
|
|
|
|
Private,
|
|
|
|
|
Shielded,
|
|
|
|
|
Deshielded,
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-10 14:09:31 +03:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
|
///General transaction object
|
|
|
|
|
pub struct Transaction {
|
2024-10-14 13:12:59 +03:00
|
|
|
pub hash: TreeHashType,
|
2024-11-28 22:05:14 +02:00
|
|
|
pub tx_kind: TxKind,
|
|
|
|
|
///Tx input data (public part)
|
|
|
|
|
pub execution_input: Vec<u8>,
|
|
|
|
|
///Tx output data (public_part)
|
|
|
|
|
pub execution_output: Vec<u8>,
|
|
|
|
|
///Tx output utxo commitments
|
|
|
|
|
pub utxo_commitments_created_hashes: Vec<TreeHashType>,
|
|
|
|
|
///Tx output nullifiers
|
|
|
|
|
pub nullifier_created_hashes: Vec<TreeHashType>,
|
2024-11-29 12:28:08 +02:00
|
|
|
///Execution proof (private part)
|
|
|
|
|
pub execution_proof_private: String,
|
2024-10-10 14:09:31 +03:00
|
|
|
}
|