diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f73b42..13c0e07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: run: yarn lint - id: test - run: yarn test + run: yarn test:verbose - id: coverage run: yarn coverage diff --git a/package.json b/package.json index 748d74b..32df47a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "start": "hardhat node --export-all deployments/allDeployments.json", "compile": "hardhat compile", "test": "yarn test:foundry && yarn test:hardhat", + "test:verbose": "yarn test:foundry -vvv && yarn test:hardhat --verbose", "test:hardhat": "hardhat test", "test:hardhat:localhost": "yarn test:hardhat --network localhost", "test:hardhat:sepolia": "yarn test:hardhat --network sepolia", diff --git a/test/RLN.t.sol b/test/RLN.t.sol index bf1f0df..237412b 100644 --- a/test/RLN.t.sol +++ b/test/RLN.t.sol @@ -16,6 +16,9 @@ contract ArrayUnique { seen[arr[i]] = true; } } + + // contract in construction goes around the assumePayable() check + receive() external payable {} } function repeatElementIntoArray( @@ -160,7 +163,9 @@ contract RLNTest is Test { address payable to ) public { // avoid precompiles, etc + // TODO: wrap both of these in a single function assumePayable(to); + assumeNoPrecompiles(to); vm.assume(to != address(0)); uint256 idCommitment = poseidon.hash(idSecretHash); @@ -206,6 +211,7 @@ contract RLNTest is Test { ) public { // avoid precompiles, etc assumePayable(to); + assumeNoPrecompiles(to); vm.assume(to != address(0)); uint256 idCommitment = poseidon.hash(idSecretHash); @@ -234,6 +240,7 @@ contract RLNTest is Test { ) public { // avoid precompiles, etc assumePayable(to); + assumeNoPrecompiles(to); vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); vm.assume(to != address(0)); uint256 idCommitmentlen = idSecretHashes.length; @@ -276,6 +283,7 @@ contract RLNTest is Test { address payable to ) public { assumePayable(to); + assumeNoPrecompiles(to); vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0); vm.assume(to != address(0));