mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-03-23 18:53:13 +00:00
18 lines
492 B
Rust
18 lines
492 B
Rust
use crate::{PublicTransaction, error::NssaError, public_transaction::Message};
|
|
|
|
impl Message {
|
|
pub(crate) fn to_bytes(&self) -> Vec<u8> {
|
|
borsh::to_vec(&self).expect("Autoderived borsh serialization failure")
|
|
}
|
|
}
|
|
|
|
impl PublicTransaction {
|
|
pub fn to_bytes(&self) -> Vec<u8> {
|
|
borsh::to_vec(&self).expect("Autoderived borsh serialization failure")
|
|
}
|
|
|
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, NssaError> {
|
|
Ok(borsh::from_slice(bytes)?)
|
|
}
|
|
}
|