From 8a70eb7c28d2bbfe71d6eae1165907e4ea3e335d Mon Sep 17 00:00:00 2001 From: s1fr0 <28568419+s1fr0@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:23:40 +0200 Subject: [PATCH] feat(poseidon): add hash test for random value --- test/poseidon.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/poseidon.ts b/test/poseidon.ts index e69de29..1fa25d6 100644 --- a/test/poseidon.ts +++ b/test/poseidon.ts @@ -0,0 +1,21 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; + +describe("Rln", function () { + it("Deploying", async function () { + const PoseidonHasher = await ethers.getContractFactory("PoseidonHasher"); + const poseidonHasher = await PoseidonHasher.deploy(); + + await poseidonHasher.deployed(); + + console.log("PoseidonHasher deployed to:", poseidonHasher.address); + + // We test hashing for a random number + const hash = await poseidonHasher.hash("19014214495641488759237505126948346942972912379615652741039992445865937985820"); + + console.log("Hash:", hash); + + //Expect 0x0c3ac305f6a4fe9bfeb3eba978bc876e2a99208b8b56c80160cfb54ba8f02368 + + }); +});