2025-08-25 14:51:46 -03:00
|
|
|
use crate::{
|
2026-06-01 17:10:46 -03:00
|
|
|
PrivacyPreservingTransaction, error::LeeError, privacy_preserving_transaction::message::Message,
|
2025-08-25 14:51:46 -03:00
|
|
|
};
|
2025-08-18 14:28:26 -03:00
|
|
|
|
|
|
|
|
impl Message {
|
2026-03-03 23:21:08 +03:00
|
|
|
#[must_use]
|
2025-09-02 11:06:41 +03:00
|
|
|
pub fn to_bytes(&self) -> Vec<u8> {
|
2025-11-25 09:40:46 +02:00
|
|
|
borsh::to_vec(&self).expect("Autoderived borsh serialization failure")
|
2025-09-02 11:06:41 +03:00
|
|
|
}
|
|
|
|
|
|
2026-06-01 17:10:46 -03:00
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, LeeError> {
|
2025-11-19 09:00:32 +02:00
|
|
|
Ok(borsh::from_slice(bytes)?)
|
2025-09-02 11:06:41 +03:00
|
|
|
}
|
|
|
|
|
}
|
2025-09-12 15:06:49 +03:00
|
|
|
|
2025-11-19 14:28:18 +02:00
|
|
|
impl PrivacyPreservingTransaction {
|
2026-03-03 23:21:08 +03:00
|
|
|
#[must_use]
|
2025-09-12 15:06:49 +03:00
|
|
|
pub fn to_bytes(&self) -> Vec<u8> {
|
2025-11-25 09:40:46 +02:00
|
|
|
borsh::to_vec(&self).expect("Autoderived borsh serialization failure")
|
2025-09-12 15:06:49 +03:00
|
|
|
}
|
|
|
|
|
|
2026-06-01 17:10:46 -03:00
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, LeeError> {
|
2025-11-19 14:28:18 +02:00
|
|
|
Ok(borsh::from_slice(bytes)?)
|
2025-09-12 15:06:49 +03:00
|
|
|
}
|
|
|
|
|
}
|