goas: reduce the width of the MMR height field

This commit is contained in:
David Rusu 2024-08-23 13:05:33 +04:00
parent 226da49440
commit 5151438d3f
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ pub struct MMR {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Root {
pub root: [u8; 32],
pub height: u64,
pub height: u8,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@ -56,7 +56,7 @@ impl MMR {
let root = merkle::path_root(leaf, &proof.path);
for mmr_root in self.roots.iter() {
if mmr_root.height == (path_len + 1) as u64 {
if mmr_root.height == (path_len + 1) as u8 {
return mmr_root.root == root;
}
}