Skip to content

Commit

Permalink
Add suppport for Goerli in contracts interface
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjocke committed Aug 1, 2022
1 parent c0d01bb commit ad4f817
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"ethers": "^5.5.3",
"prettier": "^2.3.0",
"synthetix": "^2.74.1",
"synthetix": "^2.74.2-alpha",
"typescript": "^4.4.2"
}
}
1 change: 1 addition & 0 deletions packages/contracts-interface/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('@synthetixio/js tests', () => {
test('should include the supported networks', () => {
expect(snxjs.networkToChainId[NetworkNameById[1]]).toBe(NetworkIdByName.mainnet.toString());
expect(snxjs.networkToChainId[NetworkNameById[42]]).toBe(NetworkIdByName.kovan.toString());
expect(snxjs.networkToChainId[NetworkNameById[5]]).toBe(NetworkIdByName.goerli.toString());
});

test('should include the current network', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@synthetixio/contracts": "workspace:*",
"ethers": "^5.5.3",
"synthetix": "^2.74.1"
"synthetix": "^2.74.2-alpha"
},
"devDependencies": {
"@babel/core": "^7.11.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/contracts-interface/src/synthetix.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ declare module 'synthetix' {
fork: false,
network: 'goerli',
},
420: {
useOvm: true,
fork: false,
network: 'goerli',
},
10: {
useOvm: true,
fork: false,
Expand All @@ -128,7 +133,7 @@ declare module 'synthetix' {
'-1': {
useOvm: true,
fork: false,
network: 'goerli',
network: 'invalid',
},
} as const;
export const networkToChainId = {
Expand All @@ -138,7 +143,7 @@ declare module 'synthetix' {
kovan: 42,
'kovan-ovm': 69,
'mainnet-fork': 31337,
'goerli-ovm': '-1',
'goerli-ovm': 420,
} as const;
// eslint-disable-next-line
export function getSynths(arg: { network: NetworkName; useOvm?: boolean }): any; // Note contract interface will generate enums for this and return the correct type to consumers
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts-interface/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Synths as OptimismSynths } from '@synthetixio/contracts/build/mainnet-o
export const NetworkIdByName = {
mainnet: 1,
goerli: 5,
'goerli-ovm': 420,
'mainnet-ovm': 10,
kovan: 42,
'kovan-ovm': 69,
Expand All @@ -29,6 +30,7 @@ export const NetworkNameById = {
42: 'kovan',
10: 'mainnet-ovm',
69: 'kovan-ovm',
420: 'goerli-ovm',
31337: 'mainnet-fork',
} as const;

Expand Down

0 comments on commit ad4f817

Please sign in to comment.