From 4dee9b12ba28f76f5028c8b432c889b26a6fc00e Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 7 Jul 2022 17:44:08 +0200 Subject: [PATCH] Remove dilution. Election module does not have support for that yet --- .../src/queries/gov/useProposalQuery.ts | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/packages/queries/src/queries/gov/useProposalQuery.ts b/packages/queries/src/queries/gov/useProposalQuery.ts index 9b7b6618c..5387c390e 100644 --- a/packages/queries/src/queries/gov/useProposalQuery.ts +++ b/packages/queries/src/queries/gov/useProposalQuery.ts @@ -8,9 +8,6 @@ import request, { gql } from 'graphql-request'; import { SPACE_KEY } from './constants'; import { QueryContext } from '../../context'; -import CouncilDilution from '../../contracts/CouncilDilution'; -import { getOVMProvider } from './utils'; - const useProposalQuery = ( _: QueryContext, snapshotEndpoint: string, @@ -147,31 +144,6 @@ const useProposalQuery = ( ); } - /* Apply dilution penalties for SIP/SCCP pages */ - if (spaceKey === SPACE_KEY.PROPOSAL) { - const contract = new ethers.Contract( - CouncilDilution.address, - CouncilDilution.abi, - getOVMProvider() - ); - mappedVotes = await Promise.all( - mappedVotes.map(async (vote) => { - const dilutedValueBN = await contract.getDilutedWeightForProposal( - hash, - getAddress(vote.voter) - ); - const diluteValueNumber = Number(ethers.utils.formatEther(dilutedValueBN)); - - const dilutedResult = vote.balance * diluteValueNumber; - return { - ...vote, - balance: dilutedResult, - scores: [dilutedResult], - }; - }) - ); - } - const returnVoteHistory = () => { if (walletAddress && voterAddresses.includes(getAddress(walletAddress))) { const index = mappedVotes.findIndex(