lib: Change Obligation.serialize signature

This commit is contained in:
Davie Li 2024-04-25 02:31:06 +00:00
parent e4a4e2d97b
commit e7b5968942

View file

@ -25,8 +25,12 @@ pub struct Obligation {
} }
impl Obligation { impl Obligation {
fn serialize(self) -> Vec<u8> { fn serialize(self) -> [u8; 68] {
[&self.from[..], &self.value.to_le_bytes()[..], &self.to[..]].concat() let mut arr = [0; 68];
arr[..32].clone_from_slice(&self.from);
arr[32..36].clone_from_slice(&self.value.to_le_bytes());
arr[36..].clone_from_slice(&self.to);
arr
} }
} }