Skip to content

Commit

Permalink
test(core): process messages test
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Dec 30, 2023
1 parent 4c53b29 commit 3db370e
Showing 1 changed file with 6 additions and 31 deletions.
37 changes: 6 additions & 31 deletions core/ts/__tests__/MaciState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,12 @@ import { expect } from "chai";
import { PCommand, Message, Keypair, StateLeaf, blankStateLeafHash } from "maci-domainobjs";
import { hash5, NOTHING_UP_MY_SLEEVE, IncrementalQuinTree, AccQueue } from "maci-crypto";

import {
STATE_TREE_DEPTH,
STATE_TREE_ARITY,
STATE_TREE_SUBDEPTH,
MaciState,
packProcessMessageSmallVals,
unpackProcessMessageSmallVals,
Poll,
} from "../";

const voiceCreditBalance = BigInt(100);

const duration = 30;
const maxValues = {
maxUsers: 25,
maxMessages: 25,
maxVoteOptions: 25,
};

const treeDepths = {
intStateTreeDepth: 2,
messageTreeDepth: 3,
messageTreeSubDepth: 2,
voteOptionTreeDepth: 4,
};

const messageBatchSize = 25;

const coordinatorKeypair = new Keypair();

const calculateTotal = (tallyResult: bigint[]): bigint => tallyResult.reduce((acc, v) => acc + v, BigInt(0));
import { STATE_TREE_DEPTH, STATE_TREE_ARITY, STATE_TREE_SUBDEPTH } from "../utils/constants";
import { MaciState } from "../MaciState";
import { packProcessMessageSmallVals, unpackProcessMessageSmallVals } from "../utils/utils";
import { Poll } from "../Poll";
import { calculateTotal } from "./utils";
import { coordinatorKeypair, duration, maxValues, messageBatchSize, treeDepths, voiceCreditBalance } from "./constants";

describe("MaciState", function () {
this.timeout(100000);
Expand Down

0 comments on commit 3db370e

Please sign in to comment.