diff --git a/netlify.toml b/netlify.toml index e3d3006..92da4c0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -8,8 +8,8 @@ status = 200 [context.production.environment] - REACT_APP_GRAPH_HTTP = "https://api.thegraph.com/subgraphs/name/protofire/makerdao-governance-v1_5" - REACT_APP_GRAPH_WS = "wss://api.thegraph.com/subgraphs/name/protofire/makerdao-governance-v1_5" + REACT_APP_GRAPH_HTTP = "https://api.thegraph.com/subgraphs/name/protofire/makerdao-governance" + REACT_APP_GRAPH_WS = "wss://api.thegraph.com/subgraphs/name/protofire/makerdao-governance" REACT_APP_MKR_GRAPH_HTTP='https://api.thegraph.com/subgraphs/name/protofire/mkr-registry' REACT_APP_ETHERSCAN_API_KEY='XQ2QTEM7H4KX7AQTE9JWXD3HWTTZ46TTU9' diff --git a/src/components/PollDetails/data.ts b/src/components/PollDetails/data.ts index 94e80e1..a78f52b 100644 --- a/src/components/PollDetails/data.ts +++ b/src/components/PollDetails/data.ts @@ -47,7 +47,10 @@ export const getVoterRegistries = async (addresses, endDate) => { endDate, }) - return [...result.cold, ...result.hot] + // When cold and hot are the same the registry cames twice, so we keep only one of them + const registriesById = new Map([...result.cold, ...result.hot].map(reg => [reg.id, reg])) + + return Array.from(registriesById.values()) } export const getVoterAddresses = poll => { @@ -257,7 +260,7 @@ export const totalStaked = (poll, lookup, balances, stakedProxies) => { if (!addedColHotByVoter[voter]) { const hotBalance = balances[hot] || ZERO - const coldBalance = balances[cold] || ZERO + const coldBalance = hot !== cold ? balances[cold] || ZERO : ZERO addedColHotByVoter[voter] = true return acc.plus(proxyAmount.plus(hotBalance).plus(coldBalance))