Skip to content

Commit

Permalink
feat(app, platforms): consolidate gitcoin stamps into one (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz authored Oct 27, 2023
1 parent 5e853ca commit 48b03cd
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 633 deletions.
2 changes: 0 additions & 2 deletions app/__tests__/components/ExpiredStampModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ describe("ExpiredStampModal", () => {
"GitcoinContributorStatistics#totalContributionAmountGte#10",
"GitcoinContributorStatistics#totalContributionAmountGte#100",
"GitcoinContributorStatistics#totalContributionAmountGte#1000",
"GitcoinContributorStatistics#numGr14ContributionsGte#1",
"GitcoinContributorStatistics#numRoundsContributedToGte#1",
]);
});
it("should delete all stamps within each expired platform", async () => {
Expand Down
6 changes: 0 additions & 6 deletions app/context/ceramicContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const {
Idena,
Civic,
CyberConnect,
GrantsStack,
TrustaLabs,
} = stampPlatforms;
import { PlatformProps } from "../components/GenericPlatform";
Expand Down Expand Up @@ -228,11 +227,6 @@ if (process.env.NEXT_PUBLIC_FF_CYBERCONNECT_STAMPS === "on") {
});
}

platforms.set("GrantsStack", {
platform: new GrantsStack.GrantsStackPlatform(),
platFormGroupSpec: GrantsStack.ProviderConfig,
});

if (process.env.NEXT_PUBLIC_FF_TRUSTALABS_STAMPS === "on") {
platforms.set("TrustaLabs", {
platform: new TrustaLabs.TrustaLabsPlatform(),
Expand Down
16 changes: 7 additions & 9 deletions platforms/src/Gitcoin/App-Bindings.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { PlatformOptions, ProviderPayload } from "../types";
import { AppContext, PlatformOptions, ProviderPayload } from "../types";
import { Platform } from "../utils/platform";

export class GitcoinPlatform extends Platform {
platformId = "Gitcoin";
path = "github";
path = "Gitcoin";
clientId: string = null;
redirectUri: string = null;
isEVM = true;

banner = {
heading:
"The Gitcoin Grant stamp recognizes contributions made during Gitcoin Grants rounds 1-15 (ended September 2022). Please use the new GrantsStack stamp for donations from the latest rounds: Alpha (Jan '23) and Beta (April '23).",
heading: "Note: Verification for the Gitcoin Grants stamp only considers matching-eligible contributions.",
};

constructor(options: PlatformOptions = {}) {
Expand All @@ -18,10 +18,8 @@ export class GitcoinPlatform extends Platform {
this.redirectUri = options.redirectUri as string;
}

async getOAuthUrl(state: string): Promise<string> {
const githubUrl = await Promise.resolve(
`https://github.com/login/oauth/authorize?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&state=${state}`
);
return githubUrl;
async getProviderPayload(_appContext: AppContext): Promise<ProviderPayload> {
const result = await Promise.resolve({});
return result;
}
}
17 changes: 0 additions & 17 deletions platforms/src/Gitcoin/Providers-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ export const ProviderConfig: PlatformGroupSpec[] = [
{ title: "at least $1000", name: "GitcoinContributorStatistics#totalContributionAmountGte#1000" },
],
},
{
platformGroup: "Contributed in...",
providers: [
{ title: "GR14", name: "GitcoinContributorStatistics#numGr14ContributionsGte#1" },
{ title: "at least 1 Round", name: "GitcoinContributorStatistics#numRoundsContributedToGte#1" },
],
},
];

export const providers: Provider[] = [
Expand Down Expand Up @@ -74,14 +67,4 @@ export const providers: Provider[] = [
receivingAttribute: "total_contribution_amount",
recordAttribute: "totalContributionAmountGte",
}),
new GitcoinContributorStatisticsProvider({
threshold: 1,
receivingAttribute: "num_rounds_contribute_to",
recordAttribute: "numRoundsContributedToGte",
}),
new GitcoinContributorStatisticsProvider({
threshold: 1,
receivingAttribute: "num_gr14_contributions",
recordAttribute: "numGr14ContributionsGte",
}),
];
Loading

0 comments on commit 48b03cd

Please sign in to comment.