Skip to content

Commit

Permalink
fix: make tests compile with [email protected]
Browse files Browse the repository at this point in the history
There was a breaking change introduced in `forge-std` at
foundry-rs/forge-std#407 which breaks
compilation of `Rln.t.sol` with `[email protected]`.

This commit updates the dependency to v1.6.0 and adjusts the test source
such that it successfully compiles.

Another way to go about this would've been to just stick with `v1.5.6.`
and ensuring installation of that version.
However, I've decided to update the dependency to the latest stable
version instead.
  • Loading branch information
0x-r4bbit committed Aug 8, 2023
1 parent a092b93 commit 830cace
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
branch = v1.5.2
branch = v1.6.0
6 changes: 3 additions & 3 deletions test/Rln.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ contract RlnTest is Test {
// avoid precompiles, etc
// TODO: wrap both of these in a single function
assumePayable(to);
assumeNoPrecompiles(to);
assumeNotPrecompile(to);
vm.assume(to != address(0));

rln.register{value: MEMBERSHIP_DEPOSIT}(idCommitment);
Expand Down Expand Up @@ -118,7 +118,7 @@ contract RlnTest is Test {
function test__InvalidSlash__NoStake(uint256 idCommitment, address payable to) public {
// avoid precompiles, etc
assumePayable(to);
assumeNoPrecompiles(to);
assumeNotPrecompile(to);
vm.assume(to != address(0));

rln.register{value: MEMBERSHIP_DEPOSIT}(idCommitment);
Expand Down Expand Up @@ -171,7 +171,7 @@ contract RlnTest is Test {

function test__ValidWithdraw(address payable to) public {
assumePayable(to);
assumeNoPrecompiles(to);
assumeNotPrecompile(to);

uint256 idCommitment = 19014214495641488759237505126948346942972912379615652741039992445865937985820;

Expand Down

0 comments on commit 830cace

Please sign in to comment.