2023-03-29 06:58:42 +00:00
|
|
|
// SPDX-License-Identifier: Unlicense
|
|
|
|
pragma solidity ^0.8.15;
|
|
|
|
|
|
|
|
import "../contracts/PoseidonHasher.sol";
|
|
|
|
import "forge-std/Test.sol";
|
|
|
|
|
|
|
|
contract PoseidonHasherTest is Test {
|
|
|
|
PoseidonHasher public poseidon;
|
|
|
|
|
|
|
|
/// @dev Setup the testing environment.
|
|
|
|
function setUp() public {
|
|
|
|
poseidon = new PoseidonHasher();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @dev Ensure that you can hash a value.
|
|
|
|
function testHasher(uint256 value) public {
|
|
|
|
assertEq(poseidon.hash(value), poseidon.hash(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
function testHasher() public {
|
|
|
|
assertEq(
|
2023-07-26 10:42:37 +00:00
|
|
|
poseidon.hash(19014214495641488759237505126948346942972912379615652741039992445865937985820),
|
2023-03-29 06:58:42 +00:00
|
|
|
0x0c3ac305f6a4fe9bfeb3eba978bc876e2a99208b8b56c80160cfb54ba8f02368
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|