2026-06-01 17:10:46 -03:00
|
|
|
use crate::{PublicTransaction, error::LeeError, public_transaction::Message};
|
2025-08-12 13:10:46 -03:00
|
|
|
|
|
|
|
|
impl Message {
|
|
|
|
|
pub(crate) fn to_bytes(&self) -> Vec<u8> {
|
2025-11-25 09:40:46 +02:00
|
|
|
borsh::to_vec(&self).expect("Autoderived borsh serialization failure")
|
2025-08-12 13:10:46 -03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl PublicTransaction {
|
2026-03-03 23:21:08 +03:00
|
|
|
#[must_use]
|
2025-08-12 13:10:46 -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-08-12 13:10:46 -03:00
|
|
|
}
|
|
|
|
|
|
2026-06-01 17:10:46 -03:00
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, LeeError> {
|
2025-11-18 17:52:46 +02:00
|
|
|
Ok(borsh::from_slice(bytes)?)
|
2025-08-12 13:10:46 -03:00
|
|
|
}
|
|
|
|
|
}
|