Skip to content

Commit

Permalink
Revert "chore: get poll mode within sdk (privacy-scaling-explorations…
Browse files Browse the repository at this point in the history
…#1800)"

This reverts commit 71545c1.
  • Loading branch information
djanluka committed Sep 2, 2024
1 parent a51d3b0 commit c9c3056
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
16 changes: 3 additions & 13 deletions packages/cli/ts/commands/poll.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { ZeroAddress } from "ethers";
import {
MACI__factory as MACIFactory,
Poll__factory as PollFactory,
Tally__factory as TallyFactory,
} from "maci-contracts/typechain-types";
import { MACI__factory as MACIFactory, Poll__factory as PollFactory } from "maci-contracts/typechain-types";

import type { IGetPollArgs, IGetPollData } from "../utils/interfaces";

Expand Down Expand Up @@ -36,9 +32,9 @@ export const getPoll = async ({
logError(`Invalid poll id ${id}`);
}

const { poll: pollAddress, tally: tallyAddress } = await maciContract.polls(id);
const { poll: pollAddress } = await maciContract.polls(id);

if (pollAddress === ZeroAddress || tallyAddress === ZeroAddress) {
if (pollAddress === ZeroAddress) {
logError(`MACI contract doesn't have any deployed poll ${id}`);
}

Expand All @@ -51,10 +47,6 @@ export const getPoll = async ({
const isMerged = mergedStateRoot !== BigInt(0);
const numSignups = await (isMerged ? pollContract.numSignups() : maciContract.numSignUps());

// get the poll mode
const tallyContract = TallyFactory.connect(tallyAddress, signer ?? provider);
const mode = await tallyContract.mode();

logGreen(
quiet,
success(
Expand All @@ -64,7 +56,6 @@ export const getPoll = async ({
`End time: ${new Date(Number(deployTime + duration) * 1000).toString()}`,
`Number of signups ${numSignups}`,
`State tree merged: ${mergedStateRoot}`,
`Mode: ${mode === 0n ? "Quadratic Voting" : "Non-Quadratic Voting"}`,
].join("\n"),
),
);
Expand All @@ -76,6 +67,5 @@ export const getPoll = async ({
duration,
numSignups,
isMerged,
mode,
};
};
5 changes: 0 additions & 5 deletions packages/cli/ts/utils/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,6 @@ export interface IGetPollData {
* Whether the MACI contract's state root has been merged
*/
isMerged: boolean;

/**
* Mode of the poll
*/
mode: BigNumberish;
}

/**
Expand Down

0 comments on commit c9c3056

Please sign in to comment.