zkgroup/api/receipts/
receipt_credential_presentation.rs1use partial_default::PartialDefault;
7use serde::{Deserialize, Serialize};
8
9use crate::common::serialization::ReservedByte;
10use crate::crypto::receipt_struct::ReceiptStruct;
11use crate::{crypto, ReceiptLevel, ReceiptSerialBytes, Timestamp};
12
13#[derive(Serialize, Deserialize, PartialDefault)]
17pub struct ReceiptCredentialPresentation {
18 pub(crate) reserved: ReservedByte,
19 pub(crate) proof: crypto::proofs::ReceiptCredentialPresentationProof,
20 pub(crate) receipt_expiration_time: Timestamp,
21 pub(crate) receipt_level: ReceiptLevel,
22 pub(crate) receipt_serial_bytes: ReceiptSerialBytes,
23}
24
25impl ReceiptCredentialPresentation {
26 pub fn get_receipt_struct(&self) -> ReceiptStruct {
27 ReceiptStruct {
28 receipt_serial_bytes: self.receipt_serial_bytes,
29 receipt_expiration_time: self.receipt_expiration_time,
30 receipt_level: self.receipt_level,
31 }
32 }
33
34 pub fn get_receipt_expiration_time(&self) -> Timestamp {
35 self.receipt_expiration_time
36 }
37
38 pub fn get_receipt_level(&self) -> ReceiptLevel {
39 self.receipt_level
40 }
41
42 pub fn get_receipt_serial_bytes(&self) -> ReceiptSerialBytes {
43 self.receipt_serial_bytes
44 }
45}