Skip to content

Commit

Permalink
add goerli to incoming tx
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypollack committed Sep 18, 2019
1 parent 87ac07b commit 03f216e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/scripts/controllers/incoming-transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ const {
ROPSTEN_CODE,
RINKEBY_CODE,
KOVAN_CODE,
GOERLI_CODE,
ROPSTEN,
RINKEBY,
KOVAN,
GOERLI,
MAINNET,
} = require('./network/enums')
const networkTypeToIdMap = {
[ROPSTEN]: String(ROPSTEN_CODE),
[RINKEBY]: String(RINKEBY_CODE),
[KOVAN]: String(KOVAN_CODE),
[GOERLI]: String(GOERLI_CODE),
[MAINNET]: String(MAINNET_CODE),
}
const fetch = fetchWithTimeout({
Expand Down Expand Up @@ -52,6 +55,7 @@ class IncomingTransactionsController {
[ROPSTEN]: null,
[RINKEBY]: null,
[KOVAN]: null,
[GOERLI]: null,
[MAINNET]: null,
},
}, opts.initState)
Expand Down Expand Up @@ -178,7 +182,7 @@ class IncomingTransactionsController {
async _fetchTxs (address, fromBlock, networkType) {
let etherscanSubdomain = 'api'
const currentNetworkID = networkTypeToIdMap[networkType]
const supportedNetworkTypes = [ROPSTEN, RINKEBY, KOVAN, MAINNET]
const supportedNetworkTypes = [ROPSTEN, RINKEBY, KOVAN, GOERLI, MAINNET]

if (supportedNetworkTypes.indexOf(networkType) === -1) {
return {}
Expand Down
6 changes: 6 additions & 0 deletions test/unit/app/controllers/incoming-transactions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {
ROPSTEN,
RINKEBY,
KOVAN,
GOERLI,
MAINNET,
} = require('../../../../app/scripts/controllers/network/enums')

Expand All @@ -19,6 +20,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: null,
[RINKEBY]: null,
[KOVAN]: null,
[GOERLI]: null,
[MAINNET]: null,
},
}
Expand All @@ -31,6 +33,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
},
}
Expand All @@ -43,6 +46,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},
Expand Down Expand Up @@ -243,6 +247,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},
Expand All @@ -262,6 +267,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},
Expand Down

0 comments on commit 03f216e

Please sign in to comment.