Skip to content

Commit

Permalink
purge deprecated code (#3453)
Browse files Browse the repository at this point in the history
* wip

* lint fix

* address feedback

* fix
  • Loading branch information
thelostone-mc authored May 21, 2024
1 parent fa5cd93 commit 4e3da64
Show file tree
Hide file tree
Showing 45 changed files with 11 additions and 1,962 deletions.
25 changes: 0 additions & 25 deletions packages/builder/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,6 @@ REACT_APP_INDEXER_V2_API_URL=https://grants-stack-indexer-v2.gitcoin.co
# Search API URL where the Data Layer should point to
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://d2n9vtjeq685yt.cloudfront.net"

# ---------------------------
# Subgraph URLs
# ---------------------------

# Subgraph URLs
REACT_APP_SUBGRAPH_ARBITRUM_API="https://api.thegraph.com/subgraphs/name/gitcoinco/gitcoin-grants-arbitrum-one"
REACT_APP_SUBGRAPH_ARBITRUM_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-arbitrum-goerli"
REACT_APP_SUBGRAPH_AVALANCHE_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-avalanche-mainnet"
REACT_APP_SUBGRAPH_FANTOM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-mainnet"
REACT_APP_SUBGRAPH_FANTOM_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-testnet"
REACT_APP_SUBGRAPH_FUJI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fuji-testnet"
REACT_APP_SUBGRAPH_MAINNET_API="https://gateway.thegraph.com/api/db01d72285a54fa4864050a870e9b16d/subgraphs/id/Ba4YGqqyYVFd55zcQnXS3XYTjJARKe93LY6qNgFbrHQz"
REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-optimism-mainnet"
REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"
REACT_APP_SUBGRAPH_SEPOLIA_API=”https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet”
REACT_APP_SUBGRAPH_SCROLL_API="https://api.studio.thegraph.com/query/45391/grants-round-scroll/v0.0.2"
REACT_APP_SUBGRAPH_DEV1_API=http://localhost:8545
REACT_APP_SUBGRAPH_DEV2_API=http://localhost:8546

# --------------------------------
# Optional for local development
# --------------------------------
Expand Down
20 changes: 0 additions & 20 deletions packages/builder/.env.test
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
REACT_APP_SUBGRAPH_ARBITRUM_API="https://api.thegraph.com/subgraphs/name/gitcoinco/gitcoin-grants-arbitrum-one"
REACT_APP_SUBGRAPH_ARBITRUM_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-arbitrum-goerli"
REACT_APP_SUBGRAPH_AVALANCHE_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-avalanche-mainnet"
REACT_APP_SUBGRAPH_DEV1_API="http://local.local"
REACT_APP_SUBGRAPH_DEV2_API="http://local.local"
REACT_APP_SUBGRAPH_FANTOM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-mainnet"
REACT_APP_SUBGRAPH_FANTOM_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-testnet"
REACT_APP_SUBGRAPH_FUJI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fuji-testnet"
REACT_APP_SUBGRAPH_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-goerli-testnet"
REACT_APP_SUBGRAPH_MAINNET_API="https://api.thegraph.com/subgraphs/name/vacekj/allo-mainnet"
REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-optimism-mainnet"
REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://gitcoin-search-dev.fly.dev"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"
REACT_APP_SUBGRAPH_SEPOLIA_API=”https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet”
REACT_APP_SUBGRAPH_SCROLL_API="https://api.studio.thegraph.com/query/45391/grants-round-scroll/v0.0.2"

REACT_APP_PINATA_GATEWAY="https://pinata-gateway.com"
REACT_APP_PINATA_JWT="abcedfg"
Expand Down
3 changes: 0 additions & 3 deletions packages/builder/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ const dataLayerConfig = new DataLayer({
pageSize: 50,
},
},
subgraph: {
endpointsByChainId: getConfig().dataLayer.subgraphEndpoints,
},
indexer: {
baseUrl: `${getConfig().dataLayer.gsIndexerEndpoint}/graphql`,
},
Expand Down
3 changes: 0 additions & 3 deletions packages/builder/src/utils/test_utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ const dataLayerConfig = new DataLayer({
pageSize: 50,
},
},
subgraph: {
endpointsByChainId: "http://localhost/",
},
indexer: {
baseUrl: "http://localhost/",
},
Expand Down
20 changes: 0 additions & 20 deletions packages/common/.env.test
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
REACT_APP_SUBGRAPH_ARBITRUM_API="https://api.thegraph.com/subgraphs/name/gitcoinco/gitcoin-grants-arbitrum-one"
REACT_APP_SUBGRAPH_ARBITRUM_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-arbitrum-goerli"
REACT_APP_SUBGRAPH_AVALANCHE_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-avalanche-mainnet"
REACT_APP_SUBGRAPH_DEV1_API="http://local.local"
REACT_APP_SUBGRAPH_DEV2_API="http://local.local"
REACT_APP_SUBGRAPH_FANTOM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-mainnet"
REACT_APP_SUBGRAPH_FANTOM_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-testnet"
REACT_APP_SUBGRAPH_FUJI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fuji-testnet"
REACT_APP_SUBGRAPH_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-goerli-testnet"
REACT_APP_SUBGRAPH_MAINNET_API="https://api.thegraph.com/subgraphs/name/vacekj/allo-mainnet"
REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-optimism-mainnet"
REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://gitcoin-search-dev.fly.dev"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"
REACT_APP_SUBGRAPH_SCROLL_API="https://api.studio.thegraph.com/query/45391/grants-round-scroll/v0.0.2"
REACT_APP_ALLO_API_URL="https://grants-stack-indexer-v2.gitcoin.co/graphql"
REACT_APP_PINATA_JWT=token-test
REACT_APP_PINATA_BASE_URL=http://localhost
REACT_APP_SUBGRAPH_SEPOLIA_API=”https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet”
REACT_APP_PASSPORT_API_KEY="test-key"
REACT_APP_PASSPORT_AVALANCHE_API_KEY="test-key"
REACT_APP_PASSPORT_API_COMMUNITY_ID="0000"
Expand Down
31 changes: 0 additions & 31 deletions packages/common/src/allo/indexer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { graphql_fetch } from "../graphql_fetch";
import { AlloError } from "./allo";

export interface WaitUntilIndexerSynced {
Expand All @@ -9,42 +8,12 @@ export interface WaitUntilIndexerSynced {
}): Promise<bigint>;
}

export const waitForSubgraphSyncTo: WaitUntilIndexerSynced = async (args) => {
const { chainId, blockNumber, pollIntervalInMs = 1000 } = args;
let currentBlockNumber = await getCurrentSubgraphBlockNumber(chainId);

while (currentBlockNumber < blockNumber) {
await wait(pollIntervalInMs);
currentBlockNumber = await getCurrentSubgraphBlockNumber(chainId);
}
return currentBlockNumber;
};

function wait(ms = 1000): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}

export async function getCurrentSubgraphBlockNumber(
chainId: number
): Promise<bigint> {
const res = await graphql_fetch(
`
{
_meta {
block {
number,
hash
}
}
}
`,
chainId
);
return BigInt(res.data._meta.block.number);
}

/**
* Waits until the indexer is synchronized to a specified block number.
* @param args - Object with parameters:
Expand Down
59 changes: 0 additions & 59 deletions packages/common/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AlloVersion } from "data-layer/dist/data-layer.types";
import { z } from "zod";
import { ChainId } from "./chain-ids";

const trueStrings = ["1", "t", "T", "TRUE", "true", "True"];

Expand All @@ -20,7 +19,6 @@ export type Config = {
};
dataLayer: {
searchServiceBaseUrl: string;
subgraphEndpoints: Record<number, string>;
gsIndexerEndpoint: string;
};
pinata: {
Expand Down Expand Up @@ -150,63 +148,6 @@ export function getConfig(
.string()
.url()
.parse(process.env.REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL),
subgraphEndpoints: {
[ChainId.DEV1]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_DEV1_API),
[ChainId.DEV2]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_DEV2_API),
[ChainId.PGN]: z.string().parse(process.env.REACT_APP_SUBGRAPH_PGN_API),
[ChainId.PGN_TESTNET]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_PGN_TESTNET_API),
[ChainId.MAINNET]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_MAINNET_API),
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API),
[ChainId.FANTOM_MAINNET_CHAIN_ID]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_FANTOM_MAINNET_API),
[ChainId.FANTOM_TESTNET_CHAIN_ID]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_FANTOM_TESTNET_API),
[ChainId.ARBITRUM_GOERLI]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_ARBITRUM_GOERLI_API),
[ChainId.ARBITRUM]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_ARBITRUM_API),
[ChainId.FUJI]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_FUJI_API),
[ChainId.AVALANCHE]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_AVALANCHE_API),
[ChainId.POLYGON]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_POLYGON_API),
[ChainId.POLYGON_MUMBAI]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API),
[ChainId.ZKSYNC_ERA_TESTNET_CHAIN_ID]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API),
[ChainId.ZKSYNC_ERA_MAINNET_CHAIN_ID]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API),
[ChainId.BASE]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_BASE_API),
[ChainId.SEPOLIA]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_SEPOLIA_API),
[ChainId.SCROLL]: z
.string()
.parse(process.env.REACT_APP_SUBGRAPH_SCROLL_API),
},
gsIndexerEndpoint: z
.string()
.url()
Expand Down
75 changes: 0 additions & 75 deletions packages/common/src/graphql_fetch.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ export { AlloV1 } from "./allo/backends/allo-v1";
export { AlloV2 } from "./allo/backends/allo-v2";
export {
createWaitForIndexerSyncTo,
getCurrentSubgraphBlockNumber,
waitForSubgraphSyncTo,
} from "./allo/indexer";
export type { WaitUntilIndexerSynced } from "./allo/indexer";
export { createPinataIpfsUploader } from "./allo/ipfs";
Expand Down Expand Up @@ -439,8 +437,6 @@ export interface Web3Instance {
signer?: Signer;
}

export { graphQlEndpoints, graphql_fetch } from "./graphql_fetch";

export function roundToPassportIdAndKeyMap(round: Round): {
communityId: string;
apiKey: string;
Expand Down
Loading

0 comments on commit 4e3da64

Please sign in to comment.