mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-10 18:03:06 +00:00
fix: full tree test
This commit is contained in:
parent
77421e6615
commit
9042b8be35
@ -32,7 +32,7 @@ contract WakuRlnV2 {
|
||||
uint8 public constant DEPTH = 20;
|
||||
|
||||
/// @notice The size of the merkle tree, i.e 2^depth
|
||||
uint32 public SET_SIZE;
|
||||
uint32 public immutable SET_SIZE;
|
||||
|
||||
/// @notice The index of the next member to be registered
|
||||
uint32 public idCommitmentIndex = 0;
|
||||
|
||||
@ -109,13 +109,10 @@ contract WakuRlnV2Test is Test {
|
||||
|
||||
function test__InvalidRegistration__FullTree() external {
|
||||
uint32 userMessageLimit = 2;
|
||||
// we modify the set_size to be small so the test can run faster
|
||||
stdstore.target(address(w)).sig("SET_SIZE()").checked_write(1);
|
||||
vm.pauseGasMetering();
|
||||
w.register(1, userMessageLimit);
|
||||
vm.resumeGasMetering();
|
||||
// we progress the tree to the last leaf
|
||||
stdstore.target(address(w)).sig("idCommitmentIndex()").checked_write(1 << w.DEPTH());
|
||||
vm.expectRevert(FullTree.selector);
|
||||
w.register(2, userMessageLimit);
|
||||
w.register(1, userMessageLimit);
|
||||
}
|
||||
|
||||
function test__InvalidPaginationQuery__StartIndexGTEndIndex() external {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user