Skip to content

Commit

Permalink
test(poll): cleanup tests (#938)
Browse files Browse the repository at this point in the history
Co-authored-by: ctrlc03 <[email protected]>
  • Loading branch information
samajammin and ctrlc03 authored Jun 14, 2024
1 parent 507e60a commit 4fbb91a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/ts/__tests__/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,13 @@ describe("MaciState/Poll e2e", function test() {
let maciState: MaciState;
let pollId: bigint;
let poll: Poll;
let msgTree: IncrementalQuinTree;
const voteWeight = 9n;
const voteOptionIndex = 0n;
let stateIndex: number;
const userKeypair = new Keypair();

before(() => {
maciState = new MaciState(STATE_TREE_DEPTH);
msgTree = new IncrementalQuinTree(treeDepths.messageTreeDepth, NOTHING_UP_MY_SLEEVE, MESSAGE_TREE_ARITY, hash5);

pollId = maciState.deployPoll(
BigInt(Math.floor(Date.now() / 1000) + duration),
Expand Down Expand Up @@ -412,7 +410,6 @@ describe("MaciState/Poll e2e", function test() {
const message = command.encrypt(signature, sharedKey);

poll.publishMessage(message, ecdhKeypair.pubKey);
msgTree.insert(message.hash(ecdhKeypair.pubKey));

// Use the accumulator queue to compare the root of the message tree
const accumulatorQueue: AccQueue = new AccQueue(
Expand All @@ -424,7 +421,7 @@ describe("MaciState/Poll e2e", function test() {
accumulatorQueue.mergeSubRoots(0);
accumulatorQueue.merge(treeDepths.messageTreeDepth);

expect(accumulatorQueue.getRoot(treeDepths.messageTreeDepth)?.toString()).to.eq(msgTree.root.toString());
expect(accumulatorQueue.getRoot(treeDepths.messageTreeDepth)?.toString()).to.eq(poll.messageTree.root.toString());
});

it("packProcessMessageSmallVals and unpackProcessMessageSmallVals", () => {
Expand Down

0 comments on commit 4fbb91a

Please sign in to comment.