From ee5b7c305d87129eff9801e06f3b26d6484dad6c Mon Sep 17 00:00:00 2001 From: MrX-SNX Date: Fri, 30 Aug 2024 21:19:53 +0100 Subject: [PATCH] ci: remove ci stuff (#424) * ci: remove ci stuff * ci: remove more ci stuff --- governance/ui/src/mutations/useCastVotes.ts | 2 +- .../ui/src/queries/useGetUserVotingPower.ts | 2 +- governance/ui/src/utils/contracts.ts | 16 ---------------- governance/ui/src/utils/providers.ts | 6 +----- governance/ui/webpack.config.js | 4 ---- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/governance/ui/src/mutations/useCastVotes.ts b/governance/ui/src/mutations/useCastVotes.ts index f1a9ca4dc..a8ba0d532 100644 --- a/governance/ui/src/mutations/useCastVotes.ts +++ b/governance/ui/src/mutations/useCastVotes.ts @@ -45,7 +45,7 @@ export function useCastVotes( mutationKey: ['cast', councils.toString(), JSON.stringify(candidates)], mutationFn: async () => { if (signer && network && multicall) { - const isMC = process.env.CI === 'true' ? true : isMotherchain(network.id); + const isMC = isMotherchain(network.id); try { const electionModules = councils.map((council) => getCouncilContract(council).connect(signer) diff --git a/governance/ui/src/queries/useGetUserVotingPower.ts b/governance/ui/src/queries/useGetUserVotingPower.ts index 610915994..14360b105 100644 --- a/governance/ui/src/queries/useGetUserVotingPower.ts +++ b/governance/ui/src/queries/useGetUserVotingPower.ts @@ -18,7 +18,7 @@ export function useGetUserVotingPower(council: CouncilSlugs) { try { const electionModule = getCouncilContract(council).connect(motherShipProvider(network.id)); - const isMC = process.env.CI === 'true' ? true : isMotherchain(network.id); + const isMC = isMotherchain(network.id); const electionId = await electionModule.getEpochIndex(); const ballot = isMC diff --git a/governance/ui/src/utils/contracts.ts b/governance/ui/src/utils/contracts.ts index 85acd8a81..8e6559f1f 100644 --- a/governance/ui/src/utils/contracts.ts +++ b/governance/ui/src/utils/contracts.ts @@ -28,16 +28,10 @@ const TreasuryCouncilContract = new Contract( export function getCouncilContract(council: CouncilSlugs) { switch (council) { case 'spartan': - if (process.env.CI === 'true') - return SpartanCouncilContract.connect('0xBC85F11300A8EF619592fD678418Ec4eF26FBdFD'); return SpartanCouncilContract; case 'ambassador': - if (process.env.CI === 'true') - return AmbassadorCouncilContract.connect('0xCdbEf5753cE3CEbF361e143117e345ADd7498F80'); return AmbassadorCouncilContract; case 'treasury': - if (process.env.CI === 'true') - return TreasuryCouncilContract.connect('0xe3aB2C6F1C9E46Fb53eD6b297c6fff68e935B161'); return TreasuryCouncilContract; default: throw new Error('could not find contract'); @@ -46,16 +40,6 @@ export function getCouncilContract(council: CouncilSlugs) { export const SnapshotRecordContract = (chainId: number, council: CouncilSlugs) => { switch (chainId) { - case 13001: { - switch (council) { - case 'spartan': - return new Contract('0x552E469B7C88cd501C08e7759d35dC58f08C9648', abiForSnapshotMock); - case 'ambassador': - return new Contract('0x3a0186E03137B9b971EC911350A0F2D88D24FDF2', abiForSnapshotMock); - case 'treasury': - return new Contract('0xC0bFA9aC792cF691734F7b2BD252d1c2B9fBa343', abiForSnapshotMock); - } - } case 10: { switch (council) { case 'spartan': diff --git a/governance/ui/src/utils/providers.ts b/governance/ui/src/utils/providers.ts index afa00b099..a01b65a0f 100644 --- a/governance/ui/src/utils/providers.ts +++ b/governance/ui/src/utils/providers.ts @@ -2,10 +2,6 @@ import { providers } from 'ethers'; export const motherShipProvider = (networkId?: number) => { return new providers.JsonRpcProvider( - process.env.CI === 'true' - ? process.env.CI_RPC_MOTHERSHIP - : networkId === 13001 - ? 'https://testnet.snaxchain.io/' - : 'https://mainnet.snaxchain.io/' + networkId === 13001 ? 'https://testnet.snaxchain.io/' : 'https://mainnet.snaxchain.io/' ); }; diff --git a/governance/ui/webpack.config.js b/governance/ui/webpack.config.js index cbe5c7ace..fb0d85f76 100644 --- a/governance/ui/webpack.config.js +++ b/governance/ui/webpack.config.js @@ -173,10 +173,6 @@ module.exports = { ) .concat( new webpack.DefinePlugin({ - 'process.env.CI': JSON.stringify(process.env.CI || false), - 'process.env.CI_RPC_MOTHERSHIP': JSON.stringify( - process.env.CI_RPC_MOTHERSHIP || 'http://127.0.0.1:8545' - ), 'process.env.WC_PROJECT_ID': JSON.stringify( process.env.WC_PROJECT_ID || '824270fbfdf10d95099e9702d3cb3741' ),