mirror of
https://github.com/luxfhe/example-fhe-voting.git
synced 2026-10-30 18:13:24 +00:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { ethers } from "hardhat";
|
|
import hre from "hardhat";
|
|
|
|
import { waitForBlock } from "../../utils/block";
|
|
import { createFheInstance } from "../../utils/instance";
|
|
import type { Signers } from "../types";
|
|
import { shouldBehaveLikeCounter } from "./Counter.behavior";
|
|
import { deployCounterFixture, getTokensFromFaucet } from "./Counter.fixture";
|
|
|
|
describe("Unit tests", function () {
|
|
before(async function () {
|
|
this.signers = {} as Signers;
|
|
|
|
// get tokens from faucet if we're on localluxfhe and don't have a balance
|
|
await getTokensFromFaucet();
|
|
|
|
// deploy test contract
|
|
const { counter, address } = await deployCounterFixture();
|
|
this.counter = counter;
|
|
|
|
// initiate fhevmjs
|
|
this.instance = await createFheInstance(hre, address);
|
|
|
|
// set admin account/signer
|
|
const signers = await ethers.getSigners();
|
|
this.signers.admin = signers[0];
|
|
|
|
// wait for deployment block to finish
|
|
await waitForBlock(hre);
|
|
});
|
|
|
|
describe("Counter", function () {
|
|
shouldBehaveLikeCounter();
|
|
});
|
|
});
|