Merge pull request #10158 from MetaMask/Version-v8.1.11

Version v8.1.11 RC
feature/default_network_editable
Erik Marks 4 years ago committed by GitHub
commit 02f3916280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CHANGELOG.md
  2. 2
      app/manifest/_base.json
  3. 3
      package.json
  4. 12
      ui/app/components/app/wallet-overview/eth-overview.js
  5. 12
      ui/app/components/app/wallet-overview/token-overview.js
  6. 7
      ui/app/pages/swaps/index.js
  7. 22
      yarn.lock

@ -2,6 +2,9 @@
## Current Develop Branch ## Current Develop Branch
## 8.1.11 Thu Jan 07 2021
- [#10155](https://github.com/MetaMask/metamask-extension/pull/10155): Disable swaps when the current network's chainId does not match the mainnet chain ID, instead of disabling based on network ID
## 8.1.10 Fri Dec 18 2020 ## 8.1.10 Fri Dec 18 2020
- [#10084](https://github.com/MetaMask/metamask-extension/pull/10084): Set last provider when switching to a customRPC - [#10084](https://github.com/MetaMask/metamask-extension/pull/10084): Set last provider when switching to a customRPC
- [#10096](https://github.com/MetaMask/metamask-extension/pull/10096): Update `@metamask/controllers` to v5.1.0 - [#10096](https://github.com/MetaMask/metamask-extension/pull/10096): Update `@metamask/controllers` to v5.1.0

@ -78,6 +78,6 @@
"notifications" "notifications"
], ],
"short_name": "__MSG_appName__", "short_name": "__MSG_appName__",
"version": "8.1.10", "version": "8.1.11",
"web_accessible_resources": ["inpage.js", "phishing.html"] "web_accessible_resources": ["inpage.js", "phishing.html"]
} }

@ -67,7 +67,8 @@
"3box/ipfs/ipld-zcash/zcash-bitcore-lib/elliptic": "^6.5.3", "3box/ipfs/ipld-zcash/zcash-bitcore-lib/elliptic": "^6.5.3",
"3box/**/libp2p-crypto/node-forge": "^0.10.0", "3box/**/libp2p-crypto/node-forge": "^0.10.0",
"3box/**/libp2p-keychain/node-forge": "^0.10.0", "3box/**/libp2p-keychain/node-forge": "^0.10.0",
"browserify-derequire/derequire": "^2.1.1" "browserify-derequire/derequire": "^2.1.1",
"analytics-node/axios": "^0.21.1"
}, },
"dependencies": { "dependencies": {
"3box": "^1.10.2", "3box": "^1.10.2",

@ -23,7 +23,7 @@ import {
isBalanceCached, isBalanceCached,
getSelectedAccount, getSelectedAccount,
getShouldShowFiat, getShouldShowFiat,
getCurrentNetworkId, getCurrentChainId,
getCurrentKeyring, getCurrentKeyring,
} from '../../../selectors/selectors' } from '../../../selectors/selectors'
import SwapIcon from '../../ui/icon/swap-icon.component' import SwapIcon from '../../ui/icon/swap-icon.component'
@ -34,7 +34,7 @@ import {
setSwapsFromToken, setSwapsFromToken,
} from '../../../ducks/swaps/swaps' } from '../../../ducks/swaps/swaps'
import IconButton from '../../ui/icon-button' import IconButton from '../../ui/icon-button'
import { MAINNET_NETWORK_ID } from '../../../../../app/scripts/controllers/network/enums' import { MAINNET_CHAIN_ID } from '../../../../../app/scripts/controllers/network/enums'
import WalletOverview from './wallet-overview' import WalletOverview from './wallet-overview'
const EthOverview = ({ className }) => { const EthOverview = ({ className }) => {
@ -61,7 +61,7 @@ const EthOverview = ({ className }) => {
const showFiat = useSelector(getShouldShowFiat) const showFiat = useSelector(getShouldShowFiat)
const selectedAccount = useSelector(getSelectedAccount) const selectedAccount = useSelector(getSelectedAccount)
const { balance } = selectedAccount const { balance } = selectedAccount
const networkId = useSelector(getCurrentNetworkId) const chainId = useSelector(getCurrentChainId)
const enteredSwapsEvent = useNewMetricEvent({ const enteredSwapsEvent = useNewMetricEvent({
event: 'Swaps Opened', event: 'Swaps Opened',
properties: { source: 'Main View', active_currency: 'ETH' }, properties: { source: 'Main View', active_currency: 'ETH' },
@ -134,10 +134,10 @@ const EthOverview = ({ className }) => {
{swapsEnabled ? ( {swapsEnabled ? (
<IconButton <IconButton
className="eth-overview__button" className="eth-overview__button"
disabled={networkId !== MAINNET_NETWORK_ID} disabled={chainId !== MAINNET_CHAIN_ID}
Icon={SwapIcon} Icon={SwapIcon}
onClick={() => { onClick={() => {
if (networkId === MAINNET_NETWORK_ID) { if (chainId === MAINNET_CHAIN_ID) {
enteredSwapsEvent() enteredSwapsEvent()
dispatch(setSwapsFromToken(swapsEthToken)) dispatch(setSwapsFromToken(swapsEthToken))
if (usingHardwareWallet) { if (usingHardwareWallet) {
@ -152,7 +152,7 @@ const EthOverview = ({ className }) => {
<Tooltip <Tooltip
title={t('onlyAvailableOnMainnet')} title={t('onlyAvailableOnMainnet')}
position="bottom" position="bottom"
disabled={networkId === '1'} disabled={chainId === MAINNET_CHAIN_ID}
> >
{contents} {contents}
</Tooltip> </Tooltip>

@ -25,9 +25,9 @@ import {
import { import {
getAssetImages, getAssetImages,
getCurrentKeyring, getCurrentKeyring,
getCurrentNetworkId, getCurrentChainId,
} from '../../../selectors/selectors' } from '../../../selectors/selectors'
import { MAINNET_NETWORK_ID } from '../../../../../app/scripts/controllers/network/enums' import { MAINNET_CHAIN_ID } from '../../../../../app/scripts/controllers/network/enums'
import SwapIcon from '../../ui/icon/swap-icon.component' import SwapIcon from '../../ui/icon/swap-icon.component'
import SendIcon from '../../ui/icon/overview-send-icon.component' import SendIcon from '../../ui/icon/overview-send-icon.component'
@ -58,7 +58,7 @@ const TokenOverview = ({ className, token }) => {
balanceToRender, balanceToRender,
token.symbol, token.symbol,
) )
const networkId = useSelector(getCurrentNetworkId) const chainId = useSelector(getCurrentChainId)
const enteredSwapsEvent = useNewMetricEvent({ const enteredSwapsEvent = useNewMetricEvent({
event: 'Swaps Opened', event: 'Swaps Opened',
properties: { source: 'Token View', active_currency: token.symbol }, properties: { source: 'Token View', active_currency: token.symbol },
@ -100,10 +100,10 @@ const TokenOverview = ({ className, token }) => {
{swapsEnabled ? ( {swapsEnabled ? (
<IconButton <IconButton
className="token-overview__button" className="token-overview__button"
disabled={networkId !== MAINNET_NETWORK_ID} disabled={chainId !== MAINNET_CHAIN_ID}
Icon={SwapIcon} Icon={SwapIcon}
onClick={() => { onClick={() => {
if (networkId === MAINNET_NETWORK_ID) { if (chainId === MAINNET_CHAIN_ID) {
enteredSwapsEvent() enteredSwapsEvent()
dispatch( dispatch(
setSwapsFromToken({ setSwapsFromToken({
@ -125,7 +125,7 @@ const TokenOverview = ({ className, token }) => {
<Tooltip <Tooltip
title={t('onlyAvailableOnMainnet')} title={t('onlyAvailableOnMainnet')}
position="bottom" position="bottom"
disabled={networkId === '1'} disabled={chainId === MAINNET_CHAIN_ID}
> >
{contents} {contents}
</Tooltip> </Tooltip>

@ -12,6 +12,7 @@ import { I18nContext } from '../../contexts/i18n'
import { import {
getSelectedAccount, getSelectedAccount,
getCurrentNetworkId, getCurrentNetworkId,
getCurrentChainId,
} from '../../selectors/selectors' } from '../../selectors/selectors'
import { import {
getFromToken, getFromToken,
@ -47,6 +48,7 @@ import {
SWAP_FAILED_ERROR, SWAP_FAILED_ERROR,
OFFLINE_FOR_MAINTENANCE, OFFLINE_FOR_MAINTENANCE,
} from '../../helpers/constants/swaps' } from '../../helpers/constants/swaps'
import { MAINNET_CHAIN_ID } from '../../../../app/scripts/controllers/network/enums'
import { import {
resetBackgroundSwapsState, resetBackgroundSwapsState,
@ -245,6 +247,11 @@ export default function Swap() {
return () => window.removeEventListener('beforeunload', fn) return () => window.removeEventListener('beforeunload', fn)
}, [dispatch, isLoadingQuotesRoute]) }, [dispatch, isLoadingQuotesRoute])
const chainId = useSelector(getCurrentChainId)
if (chainId !== MAINNET_CHAIN_ID) {
return <Redirect to={{ pathname: DEFAULT_ROUTE }} />
}
return ( return (
<div className="swaps"> <div className="swaps">
<div className="swaps__container"> <div className="swaps__container">

@ -4572,12 +4572,12 @@ axios-retry@^3.0.2:
dependencies: dependencies:
is-retry-allowed "^1.1.0" is-retry-allowed "^1.1.0"
axios@^0.19.2: axios@^0.19.2, axios@^0.21.1:
version "0.19.2" version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
dependencies: dependencies:
follow-redirects "1.5.10" follow-redirects "^1.10.0"
babel-code-frame@^6.16.0, babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: babel-code-frame@^6.16.0, babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
version "6.26.0" version "6.26.0"
@ -7954,7 +7954,7 @@ debug@2, debug@2.6.9, debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, de
dependencies: dependencies:
ms "2.0.0" ms "2.0.0"
debug@3.1.0, debug@=3.1.0, debug@~3.1.0: debug@3.1.0, debug@~3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
@ -11378,12 +11378,10 @@ fnv1a@^1.0.1:
resolved "https://registry.yarnpkg.com/fnv1a/-/fnv1a-1.0.1.tgz#915e2d6d023c43d5224ad9f6d2a3c4156f5712f5" resolved "https://registry.yarnpkg.com/fnv1a/-/fnv1a-1.0.1.tgz#915e2d6d023c43d5224ad9f6d2a3c4156f5712f5"
integrity sha1-kV4tbQI8Q9UiStn20qPEFW9XEvU= integrity sha1-kV4tbQI8Q9UiStn20qPEFW9XEvU=
follow-redirects@1.5.10: follow-redirects@^1.10.0:
version "1.5.10" version "1.13.1"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7"
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==
dependencies:
debug "=3.1.0"
for-each@^0.3.3, for-each@~0.3.3: for-each@^0.3.3, for-each@~0.3.3:
version "0.3.3" version "0.3.3"

Loading…
Cancel
Save