Skip to content

Commit

Permalink
feat: add deploySubsidy option
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Jan 10, 2024
1 parent 4b903ec commit 560ca56
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 47 deletions.
26 changes: 22 additions & 4 deletions cli/tests/e2e/e2e.subsidy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe("e2e with Subsidy tests", function test() {
});

const users = [new Keypair(), new Keypair(), new Keypair(), new Keypair()];
const deploySubsidy = true;

before(async () => {
// deploy the smart contracts
Expand All @@ -89,6 +90,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
});

Expand Down Expand Up @@ -193,9 +195,10 @@ describe("e2e with Subsidy tests", function test() {
testSubsidyWasmPath,
useWasm,
);
await proveOnChain("0", testProofsDirPath);
await proveOnChain("0", testProofsDirPath, deploySubsidy);
await verify(
"0",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand All @@ -222,6 +225,7 @@ describe("e2e with Subsidy tests", function test() {
new Keypair(),
new Keypair(),
];
const deploySubsidy = true;

before(async () => {
// deploy the smart contracts
Expand All @@ -236,6 +240,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
});

Expand Down Expand Up @@ -285,9 +290,10 @@ describe("e2e with Subsidy tests", function test() {
testSubsidyWasmPath,
useWasm,
);
await proveOnChain("0", testProofsDirPath);
await proveOnChain("0", testProofsDirPath, deploySubsidy);
await verify(
"0",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand All @@ -304,6 +310,7 @@ describe("e2e with Subsidy tests", function test() {
});

const user = new Keypair();
const deploySubsidy = true;

before(async () => {
// deploy the smart contracts
Expand All @@ -318,6 +325,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
});

Expand Down Expand Up @@ -369,9 +377,10 @@ describe("e2e with Subsidy tests", function test() {
testSubsidyWasmPath,
useWasm,
);
await proveOnChain("0", testProofsDirPath);
await proveOnChain("0", testProofsDirPath, deploySubsidy);
await verify(
"0",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand All @@ -392,6 +401,7 @@ describe("e2e with Subsidy tests", function test() {
new Keypair(),
new Keypair(),
];
const deploySubsidy = true;

let secondPollAddresses: PollContracts;

Expand All @@ -415,6 +425,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
// signup
// eslint-disable-next-line @typescript-eslint/prefer-for-of
Expand Down Expand Up @@ -459,9 +470,10 @@ describe("e2e with Subsidy tests", function test() {
testSubsidyWasmPath,
useWasm,
);
await proveOnChain("0", testProofsDirPath);
await proveOnChain("0", testProofsDirPath, deploySubsidy);
await verify(
"0",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand All @@ -483,6 +495,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
secondPollAddresses = await deployPoll(
pollDuration,
Expand All @@ -493,6 +506,7 @@ describe("e2e with Subsidy tests", function test() {
MSG_TREE_DEPTH,
VOTE_OPTION_TREE_DEPTH,
coordinatorPubKey,
deploySubsidy,
);
});

Expand Down Expand Up @@ -597,13 +611,15 @@ describe("e2e with Subsidy tests", function test() {
await proveOnChain(
"1",
testProofsDirPath,
deploySubsidy,
maciAddresses.maciAddress,
pollAddresses.messageProcessor,
pollAddresses.tally,
pollAddresses.subsidy,
);
await verify(
"1",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand Down Expand Up @@ -640,13 +656,15 @@ describe("e2e with Subsidy tests", function test() {
await proveOnChain(
"2",
testProofsDirPath,
deploySubsidy,
maciAddresses.maciAddress,
secondPollAddresses.messageProcessor,
secondPollAddresses.tally,
secondPollAddresses.subsidy,
);
await verify(
"2",
deploySubsidy,
testTallyFilePath,
tallyData,
maciAddresses.maciAddress,
Expand Down
Loading

0 comments on commit 560ca56

Please sign in to comment.