Skip to content

Commit

Permalink
test(contracts): re-organize smart contract tests in separate files
Browse files Browse the repository at this point in the history
Currently all tests related to a Poll were inside one file (MACI.test) - these tests have been moved
into their respective files, re organized and cleaned up, and a small number of test cases were
added which were missing.
  • Loading branch information
ctrlc03 committed Dec 12, 2023
1 parent 685686b commit 70e328a
Show file tree
Hide file tree
Showing 11 changed files with 746 additions and 391 deletions.
2 changes: 1 addition & 1 deletion contracts/contracts/Poll.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ contract PollFactory is Params, IPubKey, Ownable, PollDeploymentParams {
contract Poll is Params, Utilities, SnarkCommon, Ownable, PollDeploymentParams, EmptyBallotRoots {
using SafeERC20 for ERC20;

bool internal isInit = false;
bool public isInit;
// The coordinator's public key
PubKey public coordinatorPubKey;

Expand Down
3 changes: 3 additions & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"postbuild": "cp -r ./artifacts ./build",
"test": "hardhat test",
"test-maci": "hardhat test ./tests/MACI.test.ts",
"test-poll": "hardhat test ./tests/Poll.test.ts",
"test-messageProcessor": "hardhat test ./tests/MessageProcessor.test.ts",
"test-tally": "hardhat test ./tests/Tally.test.ts",
"test-hasher": "hardhat test ./tests/Hasher.test.ts",
"test-domainObjs": "hardhat test ./tests/DomainObjs.test.ts",
"test-signupGatekeeper": "hardhat test ./tests/SignUpGatekeeper.test.ts",
Expand Down
2 changes: 0 additions & 2 deletions contracts/tests/Hasher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { sha256Hash, hashLeftRight, hash3, hash4, hash5, genRandomSalt } from "m
import { deployPoseidonContracts, linkPoseidonLibraries } from "../ts/deploy";
import { Hasher } from "../typechain-types";

require("module-alias/register");

describe("Hasher", () => {
let hasherContract: Hasher;

Expand Down
Loading

0 comments on commit 70e328a

Please sign in to comment.