fix: tests

This commit is contained in:
rymnc 2023-12-01 12:43:59 +05:30
parent 7cca053b38
commit caa3d3b2cc
No known key found for this signature in database
GPG Key ID: AAA088D5C68ECD34
2 changed files with 3 additions and 13 deletions

View File

@ -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";
@ -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();
@ -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;
@ -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 {

View File

@ -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";
@ -12,7 +11,6 @@ contract RlnTest is Test {
using stdStorage for StdStorage;
RLN public rln;
PoseidonHasher public poseidon;
TrueVerifier public trueVerifier;
FalseVerifier public falseVerifier;
@ -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.
@ -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();
@ -157,7 +153,6 @@ contract RlnTest is Test {
RLN tempRln = new RLN(
MEMBERSHIP_DEPOSIT,
2,
address(rln.poseidonHasher()),
address(falseVerifier)
);