Skip to content

Commit

Permalink
Merge pull request #366 from protofire/subgraph-address
Browse files Browse the repository at this point in the history
Subgraph address
  • Loading branch information
leolower authored Apr 7, 2020
2 parents efa8101 + d7456ba commit e908d6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
7 changes: 5 additions & 2 deletions src/components/PollDetails/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit e908d6e

Please sign in to comment.