2023-03-29 15:19:32 +05:30
|
|
|
// SPDX-License-Identifier: Unlicense
|
|
|
|
|
pragma solidity ^0.8.15;
|
|
|
|
|
|
|
|
|
|
import "../contracts/PoseidonHasher.sol";
|
|
|
|
|
import "../contracts/Rln.sol";
|
|
|
|
|
import "forge-std/Test.sol";
|
2023-03-29 17:18:00 +05:30
|
|
|
import "forge-std/StdCheats.sol";
|
2023-03-29 15:19:32 +05:30
|
|
|
import "forge-std/console.sol";
|
|
|
|
|
|
|
|
|
|
contract RLNTest is Test {
|
2023-03-29 17:18:00 +05:30
|
|
|
using stdStorage for StdStorage;
|
|
|
|
|
|
2023-03-29 15:19:32 +05:30
|
|
|
RLN public rln;
|
2023-03-29 17:18:00 +05:30
|
|
|
PoseidonHasher public poseidon;
|
2023-03-29 15:19:32 +05:30
|
|
|
|
|
|
|
|
uint256 public constant MEMBERSHIP_DEPOSIT = 1000000000000000;
|
|
|
|
|
uint256 public constant DEPTH = 20;
|
|
|
|
|
uint256 public constant SET_SIZE = 1048576;
|
|
|
|
|
|
|
|
|
|
/// @dev Setup the testing environment.
|
|
|
|
|
function setUp() public {
|
2023-03-29 17:18:00 +05:30
|
|
|
poseidon = new PoseidonHasher();
|
2023-07-03 18:17:50 +05:30
|
|
|
uint256[] memory constructMembers = new uint256[](0);
|
|
|
|
|
rln = new RLN(constructMembers, address(poseidon));
|
2023-03-29 15:19:32 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @dev Ensure that you can hash a value.
|
|
|
|
|
function test__Constants() public {
|
|
|
|
|
assertEq(rln.DEPTH(), DEPTH);
|
|
|
|
|
assertEq(rln.SET_SIZE(), SET_SIZE);
|
|
|
|
|
}
|
|
|
|
|
}
|