Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Dec 1, 2023
1 parent 7cca053 commit caa3d3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 2 additions & 7 deletions test/RLNApp.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;

import "../contracts/PoseidonHasher.sol";
import "../contracts/RlnBase.sol";
import "./Verifier.sol";
import "forge-std/Test.sol";
Expand All @@ -15,9 +14,7 @@ contract RlnApp is RlnBase {
uint256 private membershipDeposit = 1000000000000000;
uint256 private depth = 20;

constructor(address _poseidonHasher, address _verifier)
RlnBase(membershipDeposit, depth, _poseidonHasher, _verifier)
{}
constructor(address _verifier) RlnBase(membershipDeposit, depth, _verifier) {}

function _validateRegistration(uint256 idCommitment) internal pure override {
if (idCommitment != allowedIdCommitment) revert FailedValidation();
Expand All @@ -34,7 +31,6 @@ contract RlnApp is RlnBase {

contract RLNAppTest is Test {
RlnApp public rlnApp;
PoseidonHasher public poseidon;
TrueVerifier public trueVerifier;

uint256 public constant MEMBERSHIP_DEPOSIT = 1000000000000000;
Expand All @@ -43,9 +39,8 @@ contract RLNAppTest is Test {
uint256[8] public zeroedProof = [0, 0, 0, 0, 0, 0, 0, 0];

function setUp() public {
poseidon = new PoseidonHasher();
trueVerifier = new TrueVerifier();
rlnApp = new RlnApp(address(poseidon), address(trueVerifier));
rlnApp = new RlnApp(address(trueVerifier));
}

function test__Constants() public {
Expand Down
7 changes: 1 addition & 6 deletions test/Rln.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;

import "../contracts/PoseidonHasher.sol";
import "../contracts/Rln.sol";
import "./Verifier.sol";
import "forge-std/Test.sol";
Expand All @@ -12,7 +11,6 @@ contract RlnTest is Test {
using stdStorage for StdStorage;

RLN public rln;
PoseidonHasher public poseidon;
TrueVerifier public trueVerifier;
FalseVerifier public falseVerifier;

Expand All @@ -23,10 +21,9 @@ contract RlnTest is Test {

/// @dev Setup the testing environment.
function setUp() public {
poseidon = new PoseidonHasher();
trueVerifier = new TrueVerifier();
falseVerifier = new FalseVerifier();
rln = new RLN(MEMBERSHIP_DEPOSIT, DEPTH, address(poseidon), address(trueVerifier));
rln = new RLN(MEMBERSHIP_DEPOSIT, DEPTH, address(trueVerifier));
}

/// @dev Ensure that you can hash a value.
Expand Down Expand Up @@ -72,7 +69,6 @@ contract RlnTest is Test {
RLN tempRln = new RLN(
MEMBERSHIP_DEPOSIT,
2,
address(rln.poseidonHasher()),
address(rln.verifier())
);
uint256 setSize = tempRln.SET_SIZE();
Expand Down Expand Up @@ -157,7 +153,6 @@ contract RlnTest is Test {
RLN tempRln = new RLN(
MEMBERSHIP_DEPOSIT,
2,
address(rln.poseidonHasher()),
address(falseVerifier)
);

Expand Down

0 comments on commit caa3d3b

Please sign in to comment.