mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-08 17:03:12 +00:00
test: erasing non-existent membership
This commit is contained in:
parent
969d3ee22b
commit
e62b1bd12a
@ -814,4 +814,21 @@ contract WakuRlnV2Test is Test {
|
||||
);
|
||||
assertEq(fetchedImpl, newImpl);
|
||||
}
|
||||
|
||||
function test__ErasingNonExistentMembership() external {
|
||||
uint256[] memory ids = new uint256[](1);
|
||||
ids[0] = 999; // Non-existent
|
||||
assertFalse(w.isInMembershipSet(999), "ID should not exist");
|
||||
uint256 initialRoot = w.root();
|
||||
uint256 initialNextFreeIndex = w.nextFreeIndex();
|
||||
|
||||
vm.expectRevert(abi.encodeWithSelector(MembershipDoesNotExist.selector, 999));
|
||||
w.eraseMemberships(ids);
|
||||
|
||||
assertEq(w.root(), initialRoot, "Merkle root should not change");
|
||||
assertEq(w.nextFreeIndex(), initialNextFreeIndex, "Next free index should not change");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user