Skip to content

Commit

Permalink
tmp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Apr 30, 2024
1 parent 6d8e793 commit 0cde040
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/common/src/allo/allo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export interface Allo {
index: number;
status: ApplicationStatus;
}[];
strategy?: RoundCategory;
}) => AlloOperation<
Result<void>,
{
Expand Down
33 changes: 27 additions & 6 deletions packages/common/src/allo/backends/allo-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ export class AlloV2 implements Allo {
index: number;
status: ApplicationStatus;
}[];
strategy?: RoundCategory;
}): AlloOperation<
Result<void>,
{
Expand All @@ -700,12 +701,32 @@ export class AlloV2 implements Allo {
}
> {
return new AlloOperation(async ({ emit }) => {
// Note: This is for both Direct and Quadratic Funding Grants
const strategyInstance = new DonationVotingMerkleDistributionStrategy({
chain: this.chainId,
poolId: BigInt(args.roundId),
address: args.strategyAddress,
});
let strategyInstance;

switch (args.strategy) {
case RoundCategory.QuadraticFunding: {

strategyInstance = new DonationVotingMerkleDistributionStrategy({
chain: this.chainId,
poolId: BigInt(args.roundId),
address: args.strategyAddress,
});
break;
}

case RoundCategory.Direct: {
strategyInstance = new DirectGrantsLiteStrategy({
chain: this.chainId,
poolId: BigInt(args.roundId),
address: args.strategyAddress,
});
break;
}

default:
const err = new AlloError("Unsupported strategy");

Check failure on line 727 in packages/common/src/allo/backends/allo-v2.ts

View workflow job for this annotation

GitHub Actions / lint-test-typecheck

Unexpected lexical declaration in case block
return error(err);
}

const totalApplications = await strategyInstance.recipientsCounter();

Expand Down
2 changes: 1 addition & 1 deletion packages/round-manager/src/assets/manager-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import { datadogLogs } from "@datadog/browser-logs";
import { waitForSubgraphSyncTo } from "../../features/api/subgraph";
import { Signer } from "@ethersproject/abstract-signer";
import { useWallet } from "../../features/common/Auth";
import { Allo, RoundStrategyType } from "common";
import { Allo, RoundStrategyType, getRoundStrategyType } from "common";
import { Address } from "viem";
import { RoundCategory } from "data-layer";

export interface BulkUpdateGrantApplicationState {
roundId: string;
Expand Down Expand Up @@ -171,6 +172,7 @@ async function _bulkUpdateGrantApplication({
signer,
context,
roundId,
roundStrategy,
roundStrategyAddress,
applications,
selectedApplications,
Expand All @@ -180,6 +182,8 @@ async function _bulkUpdateGrantApplication({
try {
context.setContractUpdatingStatus(ProgressStatus.IN_PROGRESS);

const strategy = roundStrategy == "DirectGrants" ? RoundCategory.Direct : RoundCategory.QuadraticFunding;

const result = await allo
.bulkUpdateApplicationStatus({
roundId,
Expand All @@ -193,6 +197,7 @@ async function _bulkUpdateGrantApplication({
})),
// FIXME: use getAddress when tests stop failing because of it
strategyAddress: roundStrategyAddress as Address,
strategy: strategy,
})
.on("transactionStatus", (tx) => {
if (tx.type === "success") {
Expand Down

0 comments on commit 0cde040

Please sign in to comment.