mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-03-01 17:53:09 +00:00
18 lines
410 B
Rust
18 lines
410 B
Rust
use crate::{PublicTransaction, error::NssaError, public_transaction::Message};
|
|
|
|
impl Message {
|
|
pub(crate) fn to_bytes(&self) -> Vec<u8> {
|
|
borsh::to_vec(&self).unwrap()
|
|
}
|
|
}
|
|
|
|
impl PublicTransaction {
|
|
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)?)
|
|
}
|
|
}
|