fix: workaround assumePayable
This commit is contained in:
parent
7c081c1ad8
commit
cae34e64d8
|
@ -45,7 +45,7 @@ jobs:
|
||||||
run: yarn lint
|
run: yarn lint
|
||||||
|
|
||||||
- id: test
|
- id: test
|
||||||
run: yarn test
|
run: yarn test:verbose
|
||||||
|
|
||||||
- id: coverage
|
- id: coverage
|
||||||
run: yarn coverage
|
run: yarn coverage
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"start": "hardhat node --export-all deployments/allDeployments.json",
|
"start": "hardhat node --export-all deployments/allDeployments.json",
|
||||||
"compile": "hardhat compile",
|
"compile": "hardhat compile",
|
||||||
"test": "yarn test:foundry && yarn test:hardhat",
|
"test": "yarn test:foundry && yarn test:hardhat",
|
||||||
|
"test:verbose": "yarn test:foundry -vvv && yarn test:hardhat --verbose",
|
||||||
"test:hardhat": "hardhat test",
|
"test:hardhat": "hardhat test",
|
||||||
"test:hardhat:localhost": "yarn test:hardhat --network localhost",
|
"test:hardhat:localhost": "yarn test:hardhat --network localhost",
|
||||||
"test:hardhat:sepolia": "yarn test:hardhat --network sepolia",
|
"test:hardhat:sepolia": "yarn test:hardhat --network sepolia",
|
||||||
|
|
|
@ -16,6 +16,9 @@ contract ArrayUnique {
|
||||||
seen[arr[i]] = true;
|
seen[arr[i]] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// contract in construction goes around the assumePayable() check
|
||||||
|
receive() external payable {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function repeatElementIntoArray(
|
function repeatElementIntoArray(
|
||||||
|
@ -160,7 +163,9 @@ contract RLNTest is Test {
|
||||||
address payable to
|
address payable to
|
||||||
) public {
|
) public {
|
||||||
// avoid precompiles, etc
|
// avoid precompiles, etc
|
||||||
|
// TODO: wrap both of these in a single function
|
||||||
assumePayable(to);
|
assumePayable(to);
|
||||||
|
assumeNoPrecompiles(to);
|
||||||
vm.assume(to != address(0));
|
vm.assume(to != address(0));
|
||||||
uint256 idCommitment = poseidon.hash(idSecretHash);
|
uint256 idCommitment = poseidon.hash(idSecretHash);
|
||||||
|
|
||||||
|
@ -206,6 +211,7 @@ contract RLNTest is Test {
|
||||||
) public {
|
) public {
|
||||||
// avoid precompiles, etc
|
// avoid precompiles, etc
|
||||||
assumePayable(to);
|
assumePayable(to);
|
||||||
|
assumeNoPrecompiles(to);
|
||||||
vm.assume(to != address(0));
|
vm.assume(to != address(0));
|
||||||
uint256 idCommitment = poseidon.hash(idSecretHash);
|
uint256 idCommitment = poseidon.hash(idSecretHash);
|
||||||
|
|
||||||
|
@ -234,6 +240,7 @@ contract RLNTest is Test {
|
||||||
) public {
|
) public {
|
||||||
// avoid precompiles, etc
|
// avoid precompiles, etc
|
||||||
assumePayable(to);
|
assumePayable(to);
|
||||||
|
assumeNoPrecompiles(to);
|
||||||
vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0);
|
vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0);
|
||||||
vm.assume(to != address(0));
|
vm.assume(to != address(0));
|
||||||
uint256 idCommitmentlen = idSecretHashes.length;
|
uint256 idCommitmentlen = idSecretHashes.length;
|
||||||
|
@ -276,6 +283,7 @@ contract RLNTest is Test {
|
||||||
address payable to
|
address payable to
|
||||||
) public {
|
) public {
|
||||||
assumePayable(to);
|
assumePayable(to);
|
||||||
|
assumeNoPrecompiles(to);
|
||||||
vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0);
|
vm.assume(isUniqueArray(idSecretHashes) && idSecretHashes.length > 0);
|
||||||
vm.assume(to != address(0));
|
vm.assume(to != address(0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue