Skip to content

Commit

Permalink
Remove testnet tinlake pools
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Aug 15, 2024
1 parent 4d308e3 commit aced105
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
22 changes: 4 additions & 18 deletions centrifuge-app/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,32 +120,20 @@ const CENTRIFUGE: EnvironmentConfig = {
},
poolCreationType,
}

const ethNetwork = import.meta.env.REACT_APP_TINLAKE_NETWORK || 'mainnet'

const alchemyKey = import.meta.env.REACT_APP_ALCHEMY_KEY

const goerliConfig = {
rpcUrl: `https://eth-sepolia.g.alchemy.com/v2/${alchemyKey}`,
chainId: 5,
poolRegistryAddress: '0x5ba1e12693dc8f9c48aad8770482f4739beed696',
tinlakeUrl: 'https://goerli.staging.tinlake.cntrfg.com/',
poolsHash: 'QmQe9NTiVJnVcb4srw6sBpHefhYieubR7v3J8ZriULQ8vB', // TODO: add registry to config and fetch poolHash
blockExplorerUrl: 'https://goerli.etherscan.io',
}
const mainnetConfig = {
export const ethConfig = {
rpcUrl: `https://eth-mainnet.g.alchemy.com/v2/${alchemyKey}`,
chainId: 1,
poolRegistryAddress: '0x5ba1e12693dc8f9c48aad8770482f4739beed696',
poolRegistryAddress: '0xcA11bde05977b3631167028862bE2a173976CA11',
tinlakeUrl: 'https://tinlake.centrifuge.io',
poolsHash: 'QmaMA1VYSKuuYhBcQCyf5Ek4VoiiEG6oLGp3iGbsQPGpkS', // TODO: add registry to config and fetch poolHash
blockExplorerUrl: 'https://etherscan.io',
}

export const ethConfig = {
network: ethNetwork,
multicallContractAddress: '0x5ba1e12693dc8f9c48aad8770482f4739beed696', // Same for all networks
multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11', // Same for all networks
remarkerAddress: '0x3E39db43035981c2C31F7Ffa4392f25231bE4477', // Same for all networks
...(ethNetwork === 'goerli' ? goerliConfig : mainnetConfig),
}

export const config = import.meta.env.REACT_APP_NETWORK === 'altair' ? ALTAIR : CENTRIFUGE
Expand All @@ -159,8 +147,6 @@ export const parachainIcons: Record<number, string> = {
[assetHubChainId]: assetHubLogo,
}

const infuraKey = import.meta.env.REACT_APP_INFURA_KEY

export const evmChains: EvmChains = {
1: {
name: 'Ethereum',
Expand Down
9 changes: 9 additions & 0 deletions centrifuge-app/src/utils/tinlake/useTinlakePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ export function useIpfsPools(suspense = false) {

export function useTinlakePools(suspense = false) {
const ipfsPools = useIpfsPools(suspense)

if (ethConfig.network !== 'mainnet') {
return useQuery(['tinlakePools', !!ipfsPools], () => [] as any as { pools: TinlakePool[] }, {

Check failure on line 138 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

Check failure on line 138 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

Check failure on line 138 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / app-pr-deploy / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?
enabled: !!ipfsPools,
staleTime: Infinity,
suspense,
})
}

return useQuery(['tinlakePools', !!ipfsPools], () => getPools(ipfsPools!), {

Check failure on line 145 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

Check failure on line 145 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?

Check failure on line 145 in centrifuge-app/src/utils/tinlake/useTinlakePools.ts

View workflow job for this annotation

GitHub Actions / app-pr-deploy / build-app

React Hook "useQuery" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?
enabled: !!ipfsPools,
staleTime: Infinity,
Expand Down

0 comments on commit aced105

Please sign in to comment.