Skip to content

Commit 969d841

Browse files
committed
test: add constants tests
1 parent e53ff20 commit 969d841

File tree

1 file changed

+14
-0
lines changed
  • packages/contracts/noir/common/src

1 file changed

+14
-0
lines changed

packages/contracts/noir/common/src/lib.nr

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,17 @@ impl std::ops::Sub for TokenAmount {
9999
pub struct TreeRoots {
100100
pub note_hash_root: Field,
101101
}
102+
103+
mod tests {
104+
#[test]
105+
fn test_constants() {
106+
assert_eq(
107+
crate::MAX_NULLIFIERS_PER_ROLLUP,
108+
(2 as Field).pow_32(crate::NULLIFIER_SUBTREE_HEIGHT as Field) as u32,
109+
);
110+
assert_eq(
111+
crate::MAX_NOTES_PER_ROLLUP,
112+
(2 as Field).pow_32(crate::NOTE_HASH_SUBTREE_HEIGHT as Field) as u32,
113+
);
114+
}
115+
}

0 commit comments

Comments
 (0)