From 7c081c1ad8163f0901ef700e653c001444cc2b09 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Wed, 29 Mar 2023 17:29:33 +0530 Subject: [PATCH] fix: reorder assumePayable --- test/RLN.t.sol | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/RLN.t.sol b/test/RLN.t.sol index fc28541..bf1f0df 100644 --- a/test/RLN.t.sol +++ b/test/RLN.t.sol @@ -160,8 +160,8 @@ contract RLNTest is Test { address payable to ) public { // avoid precompiles, etc - vm.assume(to != address(0)); assumePayable(to); + vm.assume(to != address(0)); uint256 idCommitment = poseidon.hash(idSecretHash); rln.register{value: MEMBERSHIP_DEPOSIT}(idCommitment); @@ -205,8 +205,8 @@ contract RLNTest is Test { address payable to ) public { // avoid precompiles, etc - vm.assume(to != address(0)); assumePayable(to); + vm.assume(to != address(0)); uint256 idCommitment = poseidon.hash(idSecretHash); rln.register{value: MEMBERSHIP_DEPOSIT}(idCommitment); @@ -233,9 +233,9 @@ contract RLNTest is Test { address payable to ) public { // avoid precompiles, etc - vm.assume(to != address(0)); - vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); assumePayable(to); + vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); + vm.assume(to != address(0)); uint256 idCommitmentlen = idSecretHashes.length; uint256[] memory idCommitments = new uint256[](idCommitmentlen); for (uint256 i = 0; i < idCommitmentlen; i++) { @@ -275,10 +275,9 @@ contract RLNTest is Test { uint256[] calldata idSecretHashes, address payable to ) public { - vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); - - vm.assume(to != address(0)); assumePayable(to); + vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); + vm.assume(to != address(0)); vm.expectRevert( bytes("RLN, withdrawBatch: batch size mismatch receivers")