Merge pull request #7189 from MetaMask/add-goerli-to-incoming-tx

add goerli to incoming tx
feature/default_network_editable
Jenny Pollack 5 years ago committed by GitHub
commit 5b309afc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/scripts/controllers/incoming-transactions.js
  2. 6
      test/unit/app/controllers/incoming-transactions-test.js

@ -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({
@ -52,6 +55,7 @@ class IncomingTransactionsController {
[ROPSTEN]: null,
[RINKEBY]: null,
[KOVAN]: null,
[GOERLI]: null,
[MAINNET]: null,
},
}, opts.initState)
@ -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 {}

@ -9,6 +9,7 @@ const {
ROPSTEN,
RINKEBY,
KOVAN,
GOERLI,
MAINNET,
} = require('../../../../app/scripts/controllers/network/enums')
@ -19,6 +20,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: null,
[RINKEBY]: null,
[KOVAN]: null,
[GOERLI]: null,
[MAINNET]: null,
},
}
@ -31,6 +33,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
},
}
@ -43,6 +46,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},
@ -243,6 +247,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},
@ -262,6 +267,7 @@ describe('IncomingTransactionsController', () => {
[ROPSTEN]: 1,
[RINKEBY]: 2,
[KOVAN]: 3,
[GOERLI]: 5,
[MAINNET]: 4,
FAKE_NETWORK: 1111,
},

Loading…
Cancel
Save