1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use crate::errors::TransactionError;
use snarkvm_utilities::bytes::{FromBytes, ToBytes};
use std::hash::Hash;
pub trait Transaction: Clone + Eq + FromBytes + ToBytes {
type Commitment: Clone + Eq + Hash + FromBytes + ToBytes;
type Digest: Clone + Eq + Hash + FromBytes + ToBytes;
type InnerSNARKID: Clone + Eq + FromBytes + ToBytes;
type LocalDataRoot: Clone + Eq + Hash + FromBytes + ToBytes;
type Memorandum: Clone + Eq + Hash + FromBytes + ToBytes;
type ProgramCommitment: Clone + Eq + Hash + FromBytes + ToBytes;
type SerialNumber: Clone + Eq + Hash + FromBytes + ToBytes;
type EncryptedRecord: Clone + Eq + FromBytes + ToBytes;
type ValueBalance: Clone + Eq + FromBytes + ToBytes;
fn transaction_id(&self) -> Result<[u8; 32], TransactionError>;
fn network_id(&self) -> u8;
fn ledger_digest(&self) -> &Self::Digest;
fn inner_circuit_id(&self) -> &Self::InnerSNARKID;
fn old_serial_numbers(&self) -> &[Self::SerialNumber];
fn new_commitments(&self) -> &[Self::Commitment];
fn program_commitment(&self) -> &Self::ProgramCommitment;
fn local_data_root(&self) -> &Self::LocalDataRoot;
fn value_balance(&self) -> Self::ValueBalance;
fn encrypted_records(&self) -> &[Self::EncryptedRecord];
fn memorandum(&self) -> &Self::Memorandum;
fn size(&self) -> usize;
}