mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-27 01:23:17 +00:00
25 lines
567 B
Rust
25 lines
567 B
Rust
use crate::{
|
|
PrivacyPreservingTransaction, error::NssaError,
|
|
privacy_preserving_transaction::message::Message,
|
|
};
|
|
|
|
impl Message {
|
|
pub fn to_bytes(&self) -> Vec<u8> {
|
|
borsh::to_vec(&self).unwrap()
|
|
}
|
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, NssaError> {
|
|
Ok(borsh::from_slice(bytes)?)
|
|
}
|
|
}
|
|
|
|
impl PrivacyPreservingTransaction {
|
|
pub fn to_bytes(&self) -> Vec<u8> {
|
|
borsh::to_vec(&self).unwrap()
|
|
}
|
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, NssaError> {
|
|
Ok(borsh::from_slice(bytes)?)
|
|
}
|
|
}
|