Remove unused `gasExpress` fetch mocks (#7681)

These fetch mocks have been unnecessary since #7059
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 7af09d036f
commit 3ce19ee11d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      test/e2e/fetch-mocks.json
  2. 2
      test/e2e/helpers.js
  3. 2
      test/integration/lib/confirm-sig-requests.js
  4. 2
      test/integration/lib/currency-localization.js
  5. 2
      test/integration/lib/tx-list-items.js
  6. 2
      ui/app/ducks/gas/gas-duck.test.js

@ -5916,14 +5916,6 @@
"hpa_coef": -0.0243 "hpa_coef": -0.0243
} }
], ],
"gasExpress": {
"safeLow": 2,
"standard": 3,
"fast": 10,
"fastest": 52,
"block_time": 15,
"blockNum": 6693030
},
"metametrics": { "metametrics": {
"mockMetaMetricsResponse": true "mockMetaMetricsResponse": true
} }

@ -91,8 +91,6 @@ async function setupFetchMocking (driver) {
return { json: async () => clone(fetchMockResponses.ethGasPredictTable) } return { json: async () => clone(fetchMockResponses.ethGasPredictTable) }
} else if (url.match(/chromeextensionmm/)) { } else if (url.match(/chromeextensionmm/)) {
return { json: async () => clone(fetchMockResponses.metametrics) } return { json: async () => clone(fetchMockResponses.metametrics) }
} else if (url === 'https://dev.blockscale.net/api/gasexpress.json') {
return { json: async () => clone(fetchMockResponses.gasExpress) }
} }
return window.origFetch(...args) return window.origFetch(...args)
} }

@ -28,8 +28,6 @@ async function runConfirmSigRequestsTest (assert) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) })
} else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') { } else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) })
} else if (args[0] === 'https://dev.blockscale.net/api/gasexpress.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.gasExpress)) })
} else if (args[0].match(/chromeextensionmm/)) { } else if (args[0].match(/chromeextensionmm/)) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) })
} }

@ -27,8 +27,6 @@ async function runCurrencyLocalizationTest (assert) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) })
} else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') { } else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) })
} else if (args[0] === 'https://dev.blockscale.net/api/gasexpress.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.gasExpress)) })
} else if (args[0].match(/chromeextensionmm/)) { } else if (args[0].match(/chromeextensionmm/)) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) })
} }

@ -32,8 +32,6 @@ async function runTxListItemsTest (assert) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) })
} else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') { } else if (args[0] === 'https://ethgasstation.info/json/predictTable.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasPredictTable)) })
} else if (args[0] === 'https://dev.blockscale.net/api/gasexpress.json') {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.gasExpress)) })
} else if (args[0].match(/chromeextensionmm/)) { } else if (args[0].match(/chromeextensionmm/)) {
return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) }) return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) })
} }

@ -67,7 +67,7 @@ describe('Gas Duck', () => {
{ expectedTime: 1, expectedWait: 0.5, gasprice: 20, somethingElse: 'foobar' }, { expectedTime: 1, expectedWait: 0.5, gasprice: 20, somethingElse: 'foobar' },
] ]
const fakeFetch = (url) => new Promise(resolve => { const fakeFetch = (url) => new Promise(resolve => {
const dataToResolve = url.match(/ethgasAPI|gasexpress/) const dataToResolve = url.match(/ethgasAPI/)
? mockEthGasApiResponse ? mockEthGasApiResponse
: mockPredictTableResponse : mockPredictTableResponse
resolve({ resolve({

Loading…
Cancel
Save