Use chain ID instead of network name for getIsMainnet (#10488)

feature/default_network_editable
David Walsh 4 years ago committed by GitHub
parent 73e0fdddd0
commit 839693b685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js
  2. 2
      ui/app/components/app/token-cell/token-cell.test.js
  3. 1
      ui/app/components/ui/currency-input/tests/currency-input.container.test.js
  4. 6
      ui/app/selectors/selectors.js
  5. 10
      ui/app/selectors/tests/custom-gas.test.js

@ -78,6 +78,7 @@ describe('gas-modal-page-container container', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
currentNetworkTxList: [
{
@ -200,6 +201,7 @@ describe('gas-modal-page-container container', function () {
provider: {
...baseMockState.metamask.provider,
type: 'rinkeby',
chainId: '0x4',
},
},
},
@ -225,6 +227,7 @@ describe('gas-modal-page-container container', function () {
provider: {
...baseMockState.metamask.provider,
type: 'rinkeby',
chainId: '0x4',
},
},
},
@ -246,6 +249,7 @@ describe('gas-modal-page-container container', function () {
provider: {
...baseMockState.metamask.provider,
type: 'mainnet',
chainId: '0x1',
},
},
},

@ -23,7 +23,7 @@ describe('Token Cell', function () {
conversionRate: 7.0,
preferences: {},
provider: {
chainId: '1',
chainId: '0x1',
ticker: 'ETH',
type: 'mainnet',
},

@ -29,6 +29,7 @@ describe('CurrencyInput container', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
},

@ -2,7 +2,7 @@ import { stripHexPrefix } from 'ethereumjs-util';
import { createSelector } from 'reselect';
import { addHexPrefix } from '../../../app/scripts/lib/util';
import {
MAINNET,
MAINNET_CHAIN_ID,
TEST_CHAINS,
NETWORK_TYPE_RPC,
} from '../../../shared/constants/network';
@ -289,8 +289,8 @@ function getSuggestedTokenCount(state) {
}
export function getIsMainnet(state) {
const networkType = getNetworkIdentifier(state);
return networkType === MAINNET;
const chainId = getCurrentChainId(state);
return chainId === MAINNET_CHAIN_ID;
}
export function getIsTestnet(state) {

@ -55,6 +55,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {
@ -105,6 +106,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {
@ -155,6 +157,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'rinkeby',
chainId: '0x4',
},
},
gas: {
@ -205,6 +208,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'rinkeby',
chainId: '0x4',
},
},
gas: {
@ -249,6 +253,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {
@ -310,6 +315,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {
@ -354,6 +360,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {
@ -404,6 +411,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'rinkeby',
chainId: '0x4',
},
},
gas: {
@ -454,6 +462,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'rinkeby',
chainId: '0x4',
},
},
gas: {
@ -498,6 +507,7 @@ describe('custom-gas selectors', function () {
},
provider: {
type: 'mainnet',
chainId: '0x1',
},
},
gas: {

Loading…
Cancel
Save