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

Commit

Permalink
allow to run on hardhat local network (#317)
Browse files Browse the repository at this point in the history
* allow to run on hardhat local network

* restore testnet

* fix

* fix test

* Lowercase
  • Loading branch information
rafinskipg authored Jan 13, 2022
1 parent d5c904c commit 60c3619
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/dai-plugin-governance/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ContractAddresses = {
kovan: { [key: string]: string };
mainnet: { [key: string]: string };
testnet?: { [key: string]: string };
goerlifork?: { [key: string]: string };
goerli?: { [key: string]: string };
};

Expand All @@ -36,6 +37,7 @@ export default {
const contractAddresses: ContractAddresses = {
kovan: require('../contracts/addresses/kovan.json'),
goerli: require('../contracts/addresses/goerli.json'),
goerlifork: require('../contracts/addresses/goerli.json'),
mainnet: require('../contracts/addresses/mainnet.json')
};

Expand Down
8 changes: 8 additions & 0 deletions packages/dai-plugin-governance/src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const netIdToName = id => {
return 'kovan';
case 999:
return 'ganache';
case 1337:
return 'testnet';
case 31337:
return 'goerlifork';
default:
return '';
}
Expand All @@ -33,6 +37,8 @@ export const netIdtoSpockUrl = id => {
case 1:
return MAINNET_URL;
case 5:
case 1337:
case 31337:
return GOERLI_URL;
case 42:
return KOVAN_URL;
Expand All @@ -46,6 +52,8 @@ export const netIdtoSpockUrlStaging = id => {
case 1:
return STAGING_MAINNET_URL;
case 5:
case 1337:
case 31337:
return GOERLI_URL;
case 42:
return KOVAN_URL;
Expand Down
1 change: 1 addition & 0 deletions packages/dai-plugin-mcd/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ let addContracts = reduce(
abi,
address: {
testnet: testnetAddress,
goerlifork: goerliAddresses[name],
// kovan no longer actively supported
// kovan: kovanAddresses[name],
goerli: goerliAddresses[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 @@ -26,6 +26,7 @@ test('addConfig outputs contract addresses for all networks', () => {
for (const token of erc20) {
expect(token.address).toEqual({
testnet: expect.any(String),
goerlifork: expect.any(String),
// kovan no longer actively supported
// kovan: expect.any(String),
goerli: expect.any(String),
Expand Down
6 changes: 6 additions & 0 deletions packages/dai/contracts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const addressMapping = {
mainnet: mainnetAddresses,
kovan: kovanAddresses,
goerli: goerliAddresses,
goerlifork: goerliAddresses,
testnet: testnetAddresses
};

Expand Down Expand Up @@ -144,5 +145,10 @@ export default [
{ name: 'goerli', networkId: 5, contracts: contractInfo('goerli') },
{ name: 'kovan', networkId: 42, contracts: contractInfo('kovan') },
{ name: 'test', networkId: 1337, contracts: contractInfo('testnet') },
{
name: 'goerlifork',
networkId: 31337,
contracts: contractInfo('goerlifork')
},
{ name: 'test', networkId: TESTNET_ID, contracts: contractInfo('testnet') }
];

0 comments on commit 60c3619

Please sign in to comment.