lib: Change Obligation.serialize signature
This commit is contained in:
parent
e4a4e2d97b
commit
e7b5968942
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue