Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
b-pmcg committed Oct 12, 2021
2 parents ca46913 + 1727891 commit c90c798
Show file tree
Hide file tree
Showing 17 changed files with 240 additions and 26 deletions.
12 changes: 12 additions & 0 deletions packages/dai-plugin-governance/contracts/addresses/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"MCD_ADM": "0x33Ed584fc655b08b2bca45E1C5b5f07c98053bC1",
"VOTE_PROXY_FACTORY": "0x1a7c1ee5eE2A3B67778ff1eA8c719A3fA1b02b6f",
"VOTE_DELEGATE_FACTORY": "0xE2d249AE3c156b132C40D07bd4d34e73c1712947",
"POLLING": "0xdbE5d00b2D8C13a77Fb03Ee50C87317dbC1B15fb",
"BATCH_POLLING": "0xdbE5d00b2D8C13a77Fb03Ee50C87317dbC1B15fb",
"MCD_ESM": "0x105BF37e7D81917b6fEACd6171335B4838e53D5e",
"MCD_END": "0xDb1d3edb80d3faA1B7257Ab4018A609E327FA50D",
"GOV": "0xc5E4eaB513A7CD12b2335e8a0D57273e13D499f7",
"MCD_IOU": "0x651D1B91e4F657392a51Dba7A6A1A1a72eC6aD1c",
"MCD_PAUSE": "0xefcd235B1f13e7fC5eab1d05C910d3c390b3439F"
}
8 changes: 5 additions & 3 deletions packages/dai-plugin-governance/contracts/contract-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"chief": {
"inception_block": {
"mainnet": "0x487813",
"kovan": "0x649575"
"kovan": "0x649575",
"goerli": "0x649575"
},
"events": {
"etch": "0x4f0892983790f53eea39a7a496f6cb40e8811b313871337b6a761efc6c67bb1f",
Expand All @@ -15,7 +16,8 @@
"pause": {
"inception_block": {
"mainnet": "8928171",
"kovan": "14764552"
"kovan": "14764552",
"goerli": "14764552"
},
"events": {
"exec": "0x168ccd6700000000000000000000000000000000000000000000000000000000",
Expand All @@ -28,4 +30,4 @@
"send_mkr_gas": 46471,
"total_link_gas": 1123568
}
}
}
1 change: 1 addition & 0 deletions packages/dai-plugin-governance/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
addConfig: function(config, { network = 'mainnet', staging = false }) {
const contractAddresses = {
kovan: require('../contracts/addresses/kovan.json'),
goerli: require('../contracts/addresses/goerli.json'),
mainnet: require('../contracts/addresses/mainnet.json')
};

Expand Down
1 change: 1 addition & 0 deletions packages/dai-plugin-governance/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
/* Spock URLs */
export const LOCAL_URL = 'http://localhost:3001/v1';
export const KOVAN_URL = 'https://staging-gov-db.makerfoundation.com/api/v1';
export const GOERLI_URL = 'https://polling-db-goerli.makerdux.com/api/v1';
export const STAGING_MAINNET_URL =
'https://polling-db-staging.makerdux.com/api/v1';
export const MAINNET_URL = 'https://polling-db-prod.makerdux.com/api/v1';
14 changes: 13 additions & 1 deletion packages/dai-plugin-governance/src/utils/helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { createGetCurrency } from '@makerdao/currency';
import BigNumber from 'bignumber.js';
import { MKR, STAGING_MAINNET_URL, KOVAN_URL, MAINNET_URL } from './constants';
import {
MKR,
STAGING_MAINNET_URL,
KOVAN_URL,
GOERLI_URL,
MAINNET_URL
} from './constants';

/**
* @desc get network name
Expand All @@ -11,6 +17,8 @@ export const netIdToName = id => {
switch (parseInt(id, 10)) {
case 1:
return 'mainnet';
case 5:
return 'goerli';
case 42:
return 'kovan';
case 999:
Expand All @@ -24,6 +32,8 @@ export const netIdtoSpockUrl = id => {
switch (parseInt(id, 10)) {
case 1:
return MAINNET_URL;
case 5:
return GOERLI_URL;
case 42:
return KOVAN_URL;
default:
Expand All @@ -35,6 +45,8 @@ export const netIdtoSpockUrlStaging = id => {
switch (parseInt(id, 10)) {
case 1:
return STAGING_MAINNET_URL;
case 5:
return GOERLI_URL;
case 42:
return KOVAN_URL;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"send_mkr_gas": 46471,
"total_link_gas": 1123568
}
}
}
162 changes: 162 additions & 0 deletions packages/dai-plugin-mcd/contracts/addresses/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"MULTICALL": "0xb8c864B60e9467398800Df34da39BF4f0c459461",
"FAUCET": "0xa473CdDD6E4FAc72481dc36f39A409D86980D187",
"MCD_DEPLOY": "0xc09880a0D6d06fa18C8bDC9dF2E203F0d0124fa1",
"MCD_GOV": "0xc5E4eaB513A7CD12b2335e8a0D57273e13D499f7",
"GOV_GUARD": "0xB9b861e8F9b29322815260B6883Bbe1DBC91dA8A",
"MCD_ADM": "0x33Ed584fc655b08b2bca45E1C5b5f07c98053bC1",
"MCD_VAT": "0xB966002DDAa2Baf48369f5015329750019736031",
"MCD_JUG": "0xC90C99FE9B5d5207A03b9F28A6E8A19C0e558916",

"MCD_DOG": "0x5cf85A37Dbd28A239698B4F9aA9a03D55C04F292",

"ILK_REGISTRY": "0x525FaC4CEc48a4eF2FBb0A72355B6255f8D5f79e",
"CLIPPER_MOM": "0xC67fFD490903521F778b2A3B2A13D0FC0Be96F98",
"MCD_CLIP_LINK_A": "0x42cbA983D2403003af554fec0e68dAC4920906CC",
"MCD_CLIP_CALC_LINK_A": "0xE3Cf29E132EFad92d604Fa5C86AA21b7c7fBB76e",

"MCD_CAT": "0xd744377001FD3411d7d0018F66E2271CB215f6fd",

"MCD_VOW": "0x23f78612769b9013b3145E43896Fa1578cAa2c2a",
"MCD_JOIN_DAI": "0x6a60b7070befb2bfc964F646efDF70388320f4E0",
"MCD_FLAP": "0x8E4B877d7eD4584b22e1508ffDAA8Ae4f6927397",
"MCD_FLOP": "0x742D041dFBA61110Bd886509CB299DF6A521B352",
"MCD_PAUSE": "0xefcd235B1f13e7fC5eab1d05C910d3c390b3439F",
"MCD_PAUSE_PROXY": "0x5DCdbD3cCF9B09EAAD03bc5f50fA2B3d3ACA0121",
"MCD_GOV_ACTIONS": "0x5857F3e0e6Fb75658037b3c3410b7446b985B353",
"MCD_DAI": "0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844",
"MCD_SPOT": "0xACe2A9106ec175bd56ec05C9E38FE1FDa8a1d758",
"MCD_POT": "0x50672F0a14B40051B65958818a7AcA3D54Bd81Af",
"MCD_END": "0xDb1d3edb80d3faA1B7257Ab4018A609E327FA50D",
"MCD_ESM": "0x105BF37e7D81917b6fEACd6171335B4838e53D5e",
"PROXY_ACTIONS": "0x4023f89983Ece35e227c49806aFc13Bc0248d178",
"PROXY_ACTIONS_END": "0xBbA4aBF0a12738f093cFD2199C5497044bAa68A8",
"PROXY_ACTIONS_DSR": "0x15679CdbDb284fe07Eff3809150126697c6e3Dd6",
"CDP_MANAGER": "0xdcBf58c9640A7bd0e062f8092d70fb981Bb52032",
"GET_CDPS": "0x7843fd599F5382328DeBB45255deB3E2e0DEC876",
"OSM_MOM": "0xEdB6b497D2e18A33130CB0D2b70343E6Dcd9EE86",
"FLIPPER_MOM": "0x7ceCdf6b214a3eBA1589eB8B844fB6Cb12B67Bd7",
"PROXY_FACTORY": "0x84eFB9c18059394172D0d69A3E58B03320001871",
"PROXY_REGISTRY": "0x46759093D8158db8BB555aC7C6F98070c56169ce",
"PROXY_PAUSE_ACTIONS": "0x8D1187FCa9A104211bd25c689C08718AD8730C83",
"PROXY_DEPLOYER": "0xc9476Fd378de5b0de5C4280D4323f6F89f723c15",

"ETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"PIP_ETH": "0x94588e35fF4d2E99ffb8D5095F35d1E37d6dDf12",
"MCD_JOIN_ETH_A": "0x2372031bB0fC735722AA4009AeBf66E8BEAF4BA1",
"MCD_JOIN_ETH_B": "0x1710BB6dF1967679bb1f247135794692F7963B46",
"MCD_JOIN_ETH_C": "0x16e6490744d4B3728966f8e72416c005EB3dEa79",

"BAT": "0x75645f86e90a1169e697707C813419977ea26779",
"PIP_BAT": "0x2BA78cb27044edCb715b03685D4bf74261170a70",
"MCD_JOIN_BAT_A": "0xfea8C23D32e4bA46d90AeD2445fBD099010eAdF5",

"USDC": "0x6Fb5ef893d44F4f88026430d82d4ef269543cB23",
"PIP_USDC": "0x838212865E2c2f4F7226fCc0A3EFc3EB139eC661",
"MCD_JOIN_USDC_A": "0x33E88C8b3530e2f19050b24f44AcB78C7114AF46",
"MCD_JOIN_USDC_B": "0x0Dc70CC4505c1952e719C9C740608A75Ca9e299e",

"WBTC": "0x7ccF0411c7932B99FC3704d68575250F032e3bB7",
"PIP_WBTC": "0xE7de200a3a29E9049E378b52BD36701A0Ce68C3b",
"MCD_JOIN_WBTC_A": "0x3cbE712a12e651eEAF430472c0C1BF1a2a18939D",

"TUSD": "0xe0B3D300E2e09c1Fd01252287dDbC70A7730ffB0",
"PIP_TUSD": "0x0ce19eA2C568890e63083652f205554C927a0caa",
"MCD_JOIN_TUSD_A": "0x5BC597f00d74fAcEE53Be784f0B7Ace63b4e2EBe",

"ZRX": "0x96E0C18524789ED3e62CD9F56aAEc7cEAC78725a",
"PIP_ZRX": "0xe9245D25F3265E9A36DcCDC72B0B5dE1eeACD4cD",
"MCD_JOIN_ZRX_A": "0xC279765B3f930742167dB91271f13353336B6C72",

"KNC": "0x9A58801cf901486Df9323bcE83A7684915DBAE54",
"PIP_KNC": "0xCB772363E2DEc06942edbc5E697F4A9114B5989c",
"MCD_JOIN_KNC_A": "0xA48f0d5DA642928BC1F5dB9De5F5d3D466500075",

"MANA": "0x347fceA8b4fD1a46e2c0DB8F79e22d293c2F8513",
"PIP_MANA": "0x001eDD66a5Cc9268159Cf24F3dC0AdcE456AAAAb",
"MCD_JOIN_MANA_A": "0xF4a1E7Dd685b4EaFBE5d0E70e20c153dee2E290b",

"PAXUSD": "0x4547863912Fe2d17D3827704138957a8317E8dCD",
"PIP_PAXUSD": "0xdF8474337c9D3f66C0b71d31C7D3596E4F517457",
"MCD_JOIN_PAXUSD_A": "0x8Ef390647A74150a79EC73FE120EaaF8bE9eEdf0",

"USDT": "0x5858f25cc225525A7494f76d90A6549749b3030B",
"PIP_USDT": "0x1fA3B8DAeE1BCEe33990f66F1a99993daD14D855",
"MCD_JOIN_USDT_A": "0xa8C62cC41AbF8A199FB484Ea363b90C3e9E01d86",

"LRC": "0xe32aC5b19051728421A8F4A8a5757D0e127a14F6",
"PIP_LRC": "0x5AD3A560BB125d00db8E94915232BA8f6166967C",
"MCD_JOIN_LRC_A": "0x12af538aCf746c0BBe076E5eBAE678e022E1F5f6",

"LINK": "0x4724A967A4F7E42474Be58AbdF64bF38603422FF",
"PIP_LINK": "0x75B4e743772D25a7998F4230cb016ddCF2c52629",
"MCD_JOIN_LINK_A": "0x4420FD4E5C414189708376F3fBAA4dCA6277369a",

"COMP": "0x8032dce0b793C21B8F7B648C01224c3b557271ED",
"PIP_COMP": "0xc3d677a5451cAFED13f748d822418098593D3599",
"MCD_JOIN_COMP_A": "0x544EFa934f26cd6FdFD86883408538150Bdd6725",

"YFI": "0xd9510EF268F8273C9b7514F0bfFe18Fe1EFC0d43",
"PIP_YFI": "0xAafF0066D05cEe0D6a38b4dac77e73d9E0a5Cf46",
"MCD_JOIN_YFI_A": "0xa318E65982E80F54486f71965A0C320858759299",

"BAL": "0x8c6e73CA229AB3933426aDb5cc829c1E4928551d",
"PIP_BAL": "0xF15993A5C5BE496b8e1c9657Fd2233b579Cd3Bc6",
"MCD_JOIN_BAL_A": "0xb31cE33511c2CCEfBc1713A783042eE670Cf5930",

"GUSD": "0x67aeF79654D8F6CF44FdC08949c308a4F6b3c45B",
"PIP_GUSD": "0x57A00620Ba1f5f81F20565ce72df4Ad695B389d7",
"MCD_JOIN_GUSD_A": "0x455451293100C5c5355db10512DEE81F75E45Edf",

"UNI": "0x82D98aA89E391c6759012df39ccDA0d9d6b24143",
"PIP_UNI": "0xf1a5b808fbA8fF80982dACe88020d4a80c91aFe6",
"MCD_JOIN_UNI_A": "0x31aE6e37964f26f4112A8Fc70e0B680F18e4DC6A",

"RENBTC": "0x30d0A215aef6DadA4771a2b30a59B842f969EfD4",
"PIP_RENBTC": "0xE7de200a3a29E9049E378b52BD36701A0Ce68C3b",
"MCD_JOIN_RENBTC_A": "0xb4576162aC5d1bC7C69bA85F39e8f694d44d09D0",

"AAVE": "0x251661BB7C6869165eF35810E5e1D25Ed57be2Fe",
"PIP_AAVE": "0xC26E53eF1F71481DE53bfb77875Ffb3aCf4d91f0",
"MCD_JOIN_AAVE_A": "0x71Ae3e3ac4412865A4E556230b92aB58d895b497",

"UNIV2DAIETH": "0x5dD9dec52a16d4d1Df10a66ac71d4731c9Dad984",
"PIP_UNIV2DAIETH": "0x044c9aeD56369aA3f696c898AEd0C38dC53c6C3D",
"MCD_JOIN_UNIV2DAIETH_A": "0x66931685b532CB4F31abfe804d2408dD34Cd419D",

"UNIV2WBTCETH": "0x7883a92ac3e914F3400e8AE6a2FF05E6BA4Bd403",
"PIP_UNIV2WBTCETH": "0xD375daC26f7eF991878136b387ca959b9ac1DDaF",
"MCD_JOIN_UNIV2WBTCETH_A": "0x345a29Db10Aa5CF068D61Bb20F74771eC7DF66FE",

"UNIV2USDCETH": "0xD90313b3E43D9a922c71d26a0fBCa75A01Bb3Aeb",
"PIP_UNIV2USDCETH": "0x54ADcaB9B99b1B548764dAB637db751eC66835F0",
"MCD_JOIN_UNIV2USDCETH_A": "0x46267d84dA4D6e7b2F5A999518Cf5DAF91E204E3",

"UNIV2DAIUSDC": "0x260719B2ef507A86116FC24341ff0994F2097D42",
"PIP_UNIV2DAIUSDC": "0xEf22289E240cFcCCdCD2B98fdefF167da10f452d",
"MCD_JOIN_UNIV2DAIUSDC_A": "0x4CEEf4EB4988cb374B0b288D685AeBE4c6d4C41E",

"UNIV2ETHUSDT": "0xfcB32e1C4A4F1C820c9304B5CFfEDfB91aE2321C",
"PIP_UNIV2ETHUSDT": "0x974f7f4dC6D91f144c87cc03749c98f85F997bc7",
"MCD_JOIN_UNIV2ETHUSDT_A": "0x46A8f8e2C0B62f5D7E4c95297bB26a457F358C82",

"UNIV2LINKETH": "0x3361fB8f923D1Aa1A45B2d2eD4B8bdF313a3dA0c",
"PIP_UNIV2LINKETH": "0x11C884B3FEE1494A666Bb20b6F6144387beAf4A6",
"MCD_JOIN_UNIV2LINKETH_A": "0x98B7023Aced6D8B889Ad7D340243C3F9c81E8c5F",

"UNIV2UNIETH": "0xB80A38E50B2990Ac83e46Fe16631fFBb94F2780b",
"PIP_UNIV2UNIETH": "0xB18BC24e52C23A77225E7cf088756581EE257Ad8",
"MCD_JOIN_UNIV2UNIETH_A": "0x52c31E3592352Cd0CBa20Fa73Da42584EC693283",

"UNIV2WBTCDAI": "0x3f78Bd3980c49611E5FA885f25Ca3a5fCbf0d7A0",
"PIP_UNIV2WBTCDAI": "0x916fc346910fd25867c81874f7F982a1FB69aac7",
"MCD_JOIN_UNIV2WBTCDAI_A": "0x04d23e99504d61050CAF46B4ce2dcb9D4135a7fD",

"UNIV2AAVEETH": "0xaF2CC6F46d1d0AB30dd45F59B562394c3E21e6f3",
"PIP_UNIV2AAVEETH": "0xFADF05B56E4b211877248cF11C0847e7F8924e10",
"MCD_JOIN_UNIV2AAVEETH_A": "0x73C4E5430768e24Fd704291699823f35953bbbA2",

"UNIV2DAIUSDT": "0xBF2C9aBbEC9755A0b6144051E19c6AD4e6fd6D71",
"PIP_UNIV2DAIUSDT": "0x2fc2706C61Fba5b941381e8838bC646908845db6",
"MCD_JOIN_UNIV2DAIUSDT_A": "0xBF70Ca17ce5032CCa7cD55a946e96f0E72f79452"
}
3 changes: 2 additions & 1 deletion packages/dai-plugin-mcd/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@makerdao/dai-plugin-mcd",
"description": "Plugin to add Multi-Collateral Dai support to dai.js",
"version": "1.6.35",
"version": "1.6.36-beta0",
"license": "MIT",
"main": "dist/index.js",
"unpkg": "umd/index.js",
Expand All @@ -17,6 +17,7 @@
"test": "yarn testchain --ci jest --runInBand",
"test:debug": "yarn testchain --ci node --inspect-brk ../../node_modules/.bin/jest --runInBand",
"test:kovan": "export NETWORK='kovan' && yarn test --config ./test/config/jestIntegrationConfig.json",
"test:goerli": "export NETWORK='goerli' && yarn test --config ./test/config/jestIntegrationConfig.json",
"test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json"
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/dai-plugin-mcd/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import uniqBy from 'lodash/uniqBy';
import { createCurrency, createCurrencyRatio } from '@makerdao/currency';
import testnetAddresses from '../contracts/addresses/testnet.json';
import kovanAddresses from '../contracts/addresses/kovan.json';
import goerliAddresses from '../contracts/addresses/goerli.json';
import mainnetAddresses from '../contracts/addresses/mainnet.json';
import abiMap from '../contracts/abiMap';
import CdpManager from './CdpManager';
Expand Down Expand Up @@ -41,6 +42,7 @@ let addContracts = reduce(
address: {
testnet: testnetAddress,
kovan: kovanAddresses[name],
goerli: goerliAddresses[name],
mainnet: mainnetAddresses[name]
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/dai-plugin-mcd/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test('addConfig outputs contract addresses for all networks', () => {
expect(token.address).toEqual({
testnet: expect.any(String),
kovan: expect.any(String),
goerli: expect.any(String),
mainnet: expect.any(String)
});
}
Expand Down
4 changes: 4 additions & 0 deletions packages/dai/contracts/addresses/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"PROXY_REGISTRY": "0x46759093D8158db8BB555aC7C6F98070c56169ce",
"MULTICALL": "0xb8c864B60e9467398800Df34da39BF4f0c459461"
}
13 changes: 4 additions & 9 deletions packages/dai/contracts/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import tokens from './tokens';
import contracts from './contracts';
import * as abis from './abis';
import kovanAddresses from './addresses/kovan.json';
import goerliAddresses from './addresses/goerli.json';
import mainnetAddresses from './addresses/mainnet.json';
import testnetAddresses from './addresses/testnet.json';

const addressMapping = {
mainnet: mainnetAddresses,
kovan: kovanAddresses,
goerli: goerliAddresses,
testnet: testnetAddresses
};

Expand Down Expand Up @@ -138,15 +140,8 @@ export default [
{ name: 'mainnet', networkId: 1, contracts: contractInfo('mainnet') },
{ name: 'morden', networkId: 2 },
{ name: 'ropsten', networkId: 3 },
{
name: 'rinkeby',
networkId: 4
},
{
name: 'goerli',
networkId: 5
},

{ name: 'rinkeby', networkId: 4 },
{ name: 'goerli', networkId: 5 },
{ name: 'kovan', networkId: 42, contracts: contractInfo('kovan') },
{ name: 'test', networkId: 1337, contracts: contractInfo('testnet') },
{ name: 'test', networkId: TESTNET_ID, contracts: contractInfo('testnet') }
Expand Down
3 changes: 2 additions & 1 deletion packages/dai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@makerdao/dai",
"version": "0.32.13",
"version": "0.32.14-beta0",
"contributors": [
"Wouter Kampmann <[email protected]>",
"Sean Brennan <[email protected]>",
Expand Down Expand Up @@ -50,6 +50,7 @@
"test:watch": "yarn test --watch",
"test:mainnet": "export NETWORK='mainnet' && jest --runInBand --config ./test/config/jestIntegrationConfig.json",
"test:kovan": "export NETWORK='kovan' && jest --runInBand --config ./test/config/jestIntegrationConfig.json",
"test:goerli": "export NETWORK='goerli' && jest --runInBand --config ./test/config/jestIntegrationConfig.json",
"test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json",
"test:build": "yarn test --config ./test/config/jestBuildConfig.json",
"repl": "../../node_modules/.bin/babel-node --experimental-repl-await scripts/repl.js"
Expand Down
15 changes: 7 additions & 8 deletions packages/dai/scripts/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ const endedRcPollInfo = maker => async pollId => {
return {
...poll,
...pollMetadata,
votes: votes.map(v => [
v.ballot.filter(x => x !== 0),
parseFloat(v.mkrSupport)
]).sort(([ballotA], [ballotB]) => {
if (ballotA.length < ballotB.length) return -1;
if (ballotB.length < ballotA.length) return 1;
return ballotA[0] - ballotB[0];
}),
votes: votes
.map(v => [v.ballot.filter(x => x !== 0), parseFloat(v.mkrSupport)])
.sort(([ballotA], [ballotB]) => {
if (ballotA.length < ballotB.length) return -1;
if (ballotB.length < ballotA.length) return 1;
return ballotA[0] - ballotB[0];
}),
tally: polls.runoff(votes)
};
};
Expand Down
6 changes: 4 additions & 2 deletions packages/dai/src/Maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ function delegateToServices(maker, services) {
for (const methodName of services[serviceName]) {
if (serviceName === 'cdp') {
maker[methodName] = () => {
throw new Error(`"${methodName}" is no longer available here. Add @makerdao/dai-plugin-scd, then use maker.service('cdp').${methodName}`);
}
throw new Error(
`"${methodName}" is no longer available here. Add @makerdao/dai-plugin-scd, then use maker.service('cdp').${methodName}`
);
};
} else {
maker[methodName] = (...args) =>
maker.service(serviceName)[methodName](...args);
Expand Down
Loading

0 comments on commit c90c798

Please sign in to comment.