Merge branch 'develop' into clearNotices

feature/default_network_editable
kumavis 6 years ago
commit 781a39c039
  1. 15
      CHANGELOG.md
  2. 45
      app/_locales/en/messages.json
  3. 18
      app/images/caret-left-black.svg
  4. 9
      app/images/wyre.svg
  5. 2
      app/manifest.json
  6. 4
      app/scripts/controllers/preferences.js
  7. 2
      app/scripts/controllers/transactions/tx-gas-utils.js
  8. 4
      app/scripts/inpage.js
  9. 4
      app/scripts/lib/auto-reload.js
  10. 2
      app/scripts/lib/buy-eth-url.js
  11. 6
      development/mock-dev.js
  12. 2
      development/ui-dev.js
  13. 2
      development/uiStore.js
  14. 2
      docs/adding-new-networks.md
  15. 2
      docs/secret-preferences.md
  16. 2
      mascara/src/app/buy-ether-widget/index.js
  17. 4
      mascara/src/app/shapeshift-form/index.js
  18. 14
      package-lock.json
  19. 18
      test/e2e/beta/metamask-beta-ui.spec.js
  20. 4
      test/unit/actions/config_test.js
  21. 4
      test/unit/actions/set_account_label_test.js
  22. 4
      test/unit/actions/set_selected_account_test.js
  23. 2
      test/unit/actions/tx_test.js
  24. 4
      test/unit/actions/view_info_test.js
  25. 4
      test/unit/actions/warning_test.js
  26. 11
      test/unit/app/buy-eth-url.spec.js
  27. 2
      test/unit/balance-formatter-test.js
  28. 4
      test/unit/reducers/unlock_vault_test.js
  29. 2
      test/unit/responsive/components/dropdown-test.js
  30. 2
      test/unit/ui/app/actions.spec.js
  31. 4
      test/unit/ui/app/components/token-cell.spec.js
  32. 4
      test/unit/ui/app/reducers/app.spec.js
  33. 4
      test/unit/ui/app/reducers/metamask.spec.js
  34. 2
      test/unit/ui/app/selectors.spec.js
  35. 2
      test/unit/util_test.js
  36. 66
      ui/.gitignore
  37. 87
      ui/app/accounts/new-account/index.js
  38. 6
      ui/app/components/app/account-dropdowns.js
  39. 12
      ui/app/components/app/account-menu/account-menu.component.js
  40. 4
      ui/app/components/app/account-menu/account-menu.container.js
  41. 0
      ui/app/components/app/account-menu/index.js
  42. 0
      ui/app/components/app/account-menu/index.scss
  43. 6
      ui/app/components/app/account-panel.js
  44. 0
      ui/app/components/app/add-token-button/add-token-button.component.js
  45. 0
      ui/app/components/app/add-token-button/index.js
  46. 0
      ui/app/components/app/add-token-button/index.scss
  47. 4
      ui/app/components/app/app-header/app-header.component.js
  48. 2
      ui/app/components/app/app-header/app-header.container.js
  49. 0
      ui/app/components/app/app-header/index.js
  50. 0
      ui/app/components/app/app-header/index.scss
  51. 0
      ui/app/components/app/bn-as-decimal-input.js
  52. 2
      ui/app/components/app/coinbase-form.js
  53. 2
      ui/app/components/app/confirm-page-container/confirm-detail-row/confirm-detail-row.component.js
  54. 0
      ui/app/components/app/confirm-page-container/confirm-detail-row/index.js
  55. 0
      ui/app/components/app/confirm-page-container/confirm-detail-row/index.scss
  56. 0
      ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js
  57. 6
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js
  58. 2
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/confirm-page-container-summary.component.js
  59. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/index.js
  60. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-summary/index.scss
  61. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/confirm-page-container-warning.component.js
  62. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/index.js
  63. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-warning/index.scss
  64. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-content/index.js
  65. 4
      ui/app/components/app/confirm-page-container/confirm-page-container-content/index.scss
  66. 2
      ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js
  67. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-header/index.js
  68. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-header/index.scss
  69. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-navigation/confirm-page-container-navigation.component.js
  70. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-navigation/index.js
  71. 0
      ui/app/components/app/confirm-page-container/confirm-page-container-navigation/index.scss
  72. 6
      ui/app/components/app/confirm-page-container/confirm-page-container.component.js
  73. 0
      ui/app/components/app/confirm-page-container/index.js
  74. 7
      ui/app/components/app/confirm-page-container/index.scss
  75. 2
      ui/app/components/app/copyable.js
  76. 0
      ui/app/components/app/customize-gas-modal/gas-modal-card.js
  77. 0
      ui/app/components/app/customize-gas-modal/gas-slider.js
  78. 10
      ui/app/components/app/customize-gas-modal/index.js
  79. 6
      ui/app/components/app/dropdowns/account-details-dropdown.js
  80. 10
      ui/app/components/app/dropdowns/components/account-dropdowns.js
  81. 0
      ui/app/components/app/dropdowns/components/dropdown.js
  82. 0
      ui/app/components/app/dropdowns/components/menu.js
  83. 0
      ui/app/components/app/dropdowns/components/network-dropdown-icon.js
  84. 0
      ui/app/components/app/dropdowns/index.js
  85. 6
      ui/app/components/app/dropdowns/network-dropdown.js
  86. 0
      ui/app/components/app/dropdowns/simple-dropdown.js
  87. 0
      ui/app/components/app/dropdowns/tests/dropdown.test.js
  88. 0
      ui/app/components/app/dropdowns/tests/menu.test.js
  89. 0
      ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js
  90. 2
      ui/app/components/app/dropdowns/tests/network-dropdown.test.js
  91. 2
      ui/app/components/app/dropdowns/token-menu-dropdown.js
  92. 2
      ui/app/components/app/ens-input.js
  93. 0
      ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.component.js
  94. 4
      ui/app/components/app/gas-customization/advanced-gas-inputs/advanced-gas-inputs.container.js
  95. 0
      ui/app/components/app/gas-customization/advanced-gas-inputs/index.js
  96. 0
      ui/app/components/app/gas-customization/advanced-gas-inputs/index.scss
  97. 25
      ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
  98. 0
      ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/index.js
  99. 4
      ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/index.scss
  100. 17
      ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
  101. Some files were not shown because too many files have changed in this diff Show More

@ -2,6 +2,21 @@
## Current Develop Branch
## 6.3.0 Mon Mar 25 2019
- [#6300](https://github.com/MetaMask/metamask-extension/pull/6300): Gas chart hidden on custom networks
- [#6301](https://github.com/MetaMask/metamask-extension/pull/6301): Fix gas fee in the submitted step of the transaction details activity log
- [#6302](https://github.com/MetaMask/metamask-extension/pull/6302): Replaces the coinbase link in the deposit modal with one for wyre
- [#6307](https://github.com/MetaMask/metamask-extension/pull/6307): Centre the notification in the current window
- [#6312](https://github.com/MetaMask/metamask-extension/pull/6312): Fixes popups not showing when screen size is odd
- [#6326](https://github.com/MetaMask/metamask-extension/pull/6326): Fix oversized loading overlay on gas customization modal.
- [#6330](https://github.com/MetaMask/metamask-extension/pull/6330): Stop reloading dapps on network change allowing dapps to decide if it should refresh or not
- [#6332](https://github.com/MetaMask/metamask-extension/pull/6332): Enable mobile sync
- [#6333](https://github.com/MetaMask/metamask-extension/pull/6333): Redesign of the settings screen
- [#6340](https://github.com/MetaMask/metamask-extension/pull/6340): Cancel transactions and signature requests on the closing of notification windows
- [#6341](https://github.com/MetaMask/metamask-extension/pull/6341): Disable transaction "Cancel" button when balance is insufficient
- [#6347](https://github.com/MetaMask/metamask-extension/pull/6347): Enable privacy mode by default for first time users
## 6.2.2 Tue Mar 12 2019
- [#6271](https://github.com/MetaMask/metamask-extension/pull/6271): Centre all notification popups

@ -11,6 +11,9 @@
"exposeDescription": {
"message": "Expose accounts to the current website. Useful for legacy dapps."
},
"chartOnlyAvailableEth": {
"message": "Chart only available on Ethereum networks."
},
"confirmExpose": {
"message": "Are you sure you want to expose your accounts to the current website?"
},
@ -41,6 +44,9 @@
"providerRequestInfo": {
"message": "This site is requesting access to view your current account address. Always make sure you trust the sites you interact with."
},
"aboutUs": {
"message": "About Us"
},
"accept": {
"message": "Accept"
},
@ -71,6 +77,12 @@
"address": {
"message": "Address"
},
"advanced": {
"message": "Advanced"
},
"advancedSettingsDescription": {
"message": "Access developer features, download State Logs, Reset Account, setup testnets and custom RPC."
},
"advancedOptions": {
"message": "Advanced Options"
},
@ -89,9 +101,6 @@
"addAcquiredTokens": {
"message": "Add the tokens you've acquired using MetaMask"
},
"advanced": {
"message": "Advanced"
},
"agreeTermsOfService": {
"message": "I agree to the Terms of Service"
},
@ -188,6 +197,12 @@
"buyCoinbaseExplainer": {
"message": "Coinbase is the world’s most popular way to buy and sell Bitcoin, Ethereum, and Litecoin."
},
"buyWithWyre": {
"message": "Buy ETH with Wyre"
},
"buyWithWyreDescription": {
"message": "Wyre lets you use aa credit card to deposit ETH right in to your MetaMask account. From the Airswap website, click \"Use Fiat\" in the top-right corner. You can also use Airswap to get started with ERC 20 tokens!"
},
"bytes": {
"message": "Bytes"
},
@ -227,6 +242,9 @@
"chromeRequiredForHardwareWallets": {
"message": "You need to use MetaMask on Google Chrome in order to connect to your Hardware Wallet."
},
"company": {
"message": "Company"
},
"confirm": {
"message": "Confirm"
},
@ -293,6 +311,9 @@
"continueToCoinbase": {
"message": "Continue to Coinbase"
},
"continueToWyre": {
"message": "Continue to Wyre"
},
"contractDeployment": {
"message": "Contract Deployment"
},
@ -607,6 +628,12 @@
"gasPriceRequired": {
"message": "Gas Price Required"
},
"general": {
"message": "General"
},
"generalSettingsDescription": {
"message": "Currency conversion, primary currency, language, blockies identicon"
},
"generatingTransaction": {
"message": "Generating transaction"
},
@ -778,6 +805,9 @@
"ledgerAccountRestriction": {
"message": "You need to make use your last account before you can add a new one."
},
"legal": {
"message": "Legal"
},
"lessThanMax": {
"message": "must be less than or equal to $1.",
"description": "helper for inputting hex as decimal input"
@ -959,6 +989,9 @@
"noTransactions": {
"message": "You have no transactions"
},
"notEnoughGas": {
"message": "Not Enough Gas"
},
"notFound": {
"message": "Not Found"
},
@ -1228,6 +1261,12 @@
"secretPhrase": {
"message": "Enter your secret twelve word phrase here to restore your vault."
},
"securityAndPrivacy": {
"message": "Security & Privacy"
},
"securitySettingsDescription": {
"message": "Privacy settings and wallet seed phrase"
},
"secondsShorthand": {
"message": "Sec"
},

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="9px" height="15px" viewBox="0 0 9 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>8439120D-5704-4273-B416-FEE134322584</title>
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Action-Screens" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Approve---insufficient-amount" transform="translate(-75.000000, -69.000000)" stroke="#000000" stroke-width="2">
<g id="Group-7" transform="translate(53.000000, 51.000000)">
<g id="cancel" transform="translate(24.000000, 14.000000)">
<g id="Group">
<polyline id="Path-8" points="6.1263881 18.0633906 0 11.6306831 6.31493631 5"></polyline>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 913 B

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="24" viewBox="0 0 72 24">
<g fill="#000000" fill-rule="evenodd">
<path d="M40.2451269,20.4956914 C42.4518577,20.8032343 43.7956269,20.4027771 44.8365115,19.3728343 C45.49005,18.7265486 45.9867808,17.96952 46.4253577,17.1740914 C48.2011269,13.9553486 52.4737038,6.17900571 52.4737038,6.17900571 L49.3957038,6.17900571 L46.1955115,12.5492914 L45.1968577,6.17900571 L41.9257038,6.17900571 L41.9257038,6.32712 C41.9257038,6.32712 43.03305,12.15912 43.6014346,15.1478057 C43.6862423,15.5931771 43.7738192,16.7393486 42.9603577,17.4806057 C42.5051654,17.89512 41.8478192,18.2396914 40.71555,18.0562629 L40.2451269,20.4956914 Z"/>
<polygon points="37.793 6.179 34.817 12.868 34.737 12.861 34.334 6.345 31.093 6.345 27.934 12.869 27.853 12.842 27.718 6.179 24.617 6.179 25.234 16.864 28.59 16.864 31.842 9.892 31.918 9.905 32.434 16.864 35.812 16.864 40.698 6.179"/>
<path d="M55.7303192 16.8643543L52.4737038 16.8643543C53.1992423 13.2612686 53.8922423 9.77921143 54.6174346 6.17886857L57.1422808 6.17886857 57.1422808 8.14481143C57.4801269 7.33258286 57.9412038 6.57624 58.7235115 6.24435429 59.4909346 5.91864 60.6772038 5.93578286 61.8866654 6.30366857 61.4103577 7.21738286 61.0472423 8.03029714 60.5314731 9.01944 60.0662423 8.92824 59.6477423 8.81166857 59.2216269 8.76984 58.2645115 8.67555429 57.5694346 9.05372571 57.2426654 9.95269714 57.01455 10.5804686 56.8726269 11.2452686 56.7348577 11.9011543 56.3893962 13.5444686 56.0685115 15.1918971 55.7303192 16.8643543M66.1421769 8.72009143C66.6077538 8.15952 67.4461385 7.84957714 68.0685231 8.04260571 68.8276385 8.27814857 69.0768692 9.11163429 68.5375615 9.69346286 68.3544462 9.89094857 68.0989846 10.0544914 67.8445615 10.14912 67.0612154 10.4405486 66.2505231 10.4316343 65.3976 10.2862629 65.5419462 9.66672 65.7704077 9.16752 66.1421769 8.72009143L66.1421769 8.72009143zM70.3102154 14.2082057C70.3102154 14.2082057 70.2828692 14.2078629 70.2011769 14.2078629 68.9543308 14.6816914 67.5707538 14.8058057 66.6171 14.5380343 65.5634077 14.2421486 64.9555615 13.33392 65.1469846 12.3080914 68.2872923 12.5696914 69.6203308 11.9775771 70.3358308 11.5538057 72.2742923 10.4055771 72.7672154 7.33220571 70.2378692 6.42226286 68.0155615 5.62272 64.9199077 6.00294857 63.4574077 7.75769143 62.1247154 9.35677714 61.7335615 11.1152914 61.9377923 13.0726629 62.0911385 14.5452343 63.1105615 16.6562057 66.4422923 16.9856914 68.4565615 17.1848914 69.7459846 16.67232 69.8397923 16.63392L70.3102154 14.2082057zM4.97682692 23.9956457L12.3824423 23.9956457C13.8428654 23.9956457 15.15825 23.1210171 15.7114038 21.7825029L19.7060192 12.11736 15.2226346 17.7649029C14.5431346 18.6614743 13.5147115 19.2443314 12.30525 19.2443314L6.94055769 19.2443314 4.97682692 23.9956457z"/>
<path d="M2.52183462,18.0546514 L9.92745,18.0546514 C11.3878731,18.0546514 12.7032577,17.1800229 13.2564115,15.8415086 L17.2513731,6.17670857 L12.7676423,11.8239086 C12.0881423,12.72048 11.0597192,13.3033371 9.85025769,13.3033371 L4.48556538,13.3033371 L2.52183462,18.0546514 Z"/>
<path d="M7.39111154,0.22872 L14.7967269,0.22872 L10.8014192,9.89489143 C10.2482654,11.2334057 8.93288077,12.1080343 7.47245769,12.1080343 L0.0668423077,12.1080343 L4.06215,2.44186286 C4.61530385,1.10334857 5.93068846,0.22872 7.39111154,0.22872"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "6.2.2",
"version": "6.3.0",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "__MSG_appDescription__",

@ -40,7 +40,9 @@ class PreferencesController {
// Feature flag toggling is available in the global namespace
// for convenient testing of pre-release features, and should never
// perform sensitive operations.
featureFlags: {},
featureFlags: {
privacyMode: true,
},
knownMethodData: {},
participateInMetaMetrics: null,
firstTimeFlowType: null,

@ -7,7 +7,7 @@ const {
const { addHexPrefix } = require('ethereumjs-util')
const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send.
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/constants/error-keys'
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/helpers/constants/error-keys'
/**
tx-gas-utils are gas utility methods for Transaction manager

@ -91,6 +91,10 @@ inpageProvider.enable = function ({ force } = {}) {
})
}
// give the dapps control of a refresh they can toggle this off on the window.ethereum
// this will be default true so it does not break any old apps.
inpageProvider.autoRefreshOnNetworkChange = true
// add metamask-specific convenience methods
inpageProvider._metamask = new Proxy({
/**

@ -20,6 +20,10 @@ function setupDappAutoReload (web3, observable) {
})
observable.subscribe(function (state) {
// if the auto refresh on network change is false do not
// do anything
if (!window.ethereum.autoRefreshOnNetworkChange) return
// if reload in progress, no need to check reload logic
if (reloadInProgress) return

@ -15,7 +15,7 @@ function getBuyEthUrl ({ network, amount, address }) {
let url
switch (network) {
case '1':
url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`
url = `https://dash.sendwyre.com/sign-up`
break
case '3':

@ -14,9 +14,9 @@
const render = require('react-dom').render
const h = require('react-hyperscript')
const Root = require('../ui/app/root')
const configureStore = require('../ui/app/store')
const actions = require('../ui/app/actions')
const Root = require('../ui/app/pages')
const configureStore = require('../ui/app/store/store')
const actions = require('../ui/app/store/actions')
const states = require('./states')
const backGroundConnectionModifiers = require('./backGroundConnectionModifiers')
const Selector = require('./selector')

@ -17,7 +17,7 @@
const render = require('react-dom').render
const h = require('react-hyperscript')
const Root = require('../ui/app/root')
const Root = require('../ui/app/pages')
const configureStore = require('./uiStore')
const states = require('./states')
const Selector = require('./selector')

@ -2,7 +2,7 @@ const createStore = require('redux').createStore
const applyMiddleware = require('redux').applyMiddleware
const thunkMiddleware = require('redux-thunk').default
const createLogger = require('redux-logger').createLogger
const rootReducer = require('../ui/app/reducers')
const rootReducer = require('../ui/app/ducks')
module.exports = configureStore

@ -5,7 +5,7 @@ To add another network to our dropdown menu, make sure the following files are a
```
app/scripts/config.js
app/scripts/lib/buy-eth-url.js
ui/app/app.js
ui/app/index.js
ui/app/components/buy-button-subview.js
ui/app/components/drop-menu-item.js
ui/app/components/network.js

@ -6,5 +6,5 @@ One example is our "sync with mobile" feature, which didn't make sense to roll o
To enable features like this, first open the background console, and then you can use the global method `global.setPreference(key, value)`.
For example, if the feature flag was a booelan was called `mobileSync`, you might type `setPreference('mobileSync', true)`.
For example, if the feature flag was a boolean was called `useNativeCurrencyAsPrimaryCurrency`, you might type `setPreference('useNativeCurrencyAsPrimaryCurrency', true)`.

@ -5,7 +5,7 @@ import {connect} from 'react-redux'
import {qrcode} from 'qrcode-generator'
import copyToClipboard from 'copy-to-clipboard'
import ShapeShiftForm from '../shapeshift-form'
import {buyEth, showAccountDetail} from '../../../../ui/app/actions'
import {buyEth, showAccountDetail} from '../../../../ui/app/store/actions'
const OPTION_VALUES = {
COINBASE: 'coinbase',

@ -3,8 +3,8 @@ import PropTypes from 'prop-types'
import classnames from 'classnames'
import qrcode from 'qrcode-generator'
import {connect} from 'react-redux'
import {shapeShiftSubview, pairUpdate, buyWithShapeShift} from '../../../../ui/app/actions'
import {isValidAddress} from '../../../../ui/app/util'
import {shapeShiftSubview, pairUpdate, buyWithShapeShift} from '../../../../ui/app/store/actions'
import {isValidAddress} from '../../../../ui/app/helpers/utils/util'
export class ShapeShiftForm extends Component {
static propTypes = {

14
package-lock.json generated

@ -9849,7 +9849,7 @@
"dependencies": {
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
"requires": {
"babel-core": "^6.0.14",
@ -9901,7 +9901,7 @@
}
},
"ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215",
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": {
"bn.js": "^4.11.8",
@ -10189,7 +10189,7 @@
}
},
"ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215",
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": {
"bn.js": "^4.11.8",
@ -10484,7 +10484,7 @@
}
},
"ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#d84a96796079c8595a0c78accd1e7709f2277215",
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": {
"bn.js": "^4.11.8",
@ -24076,7 +24076,7 @@
"dependencies": {
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
"requires": {
"babel-core": "^6.0.14",
@ -24115,7 +24115,7 @@
},
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
"requires": {
"babel-core": "^6.0.14",
@ -26541,7 +26541,7 @@
"dependencies": {
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
"requires": {
"babel-core": "^6.0.14",

@ -233,7 +233,11 @@ describe('MetaMask', function () {
await customRpcButton.click()
await delay(regularDelayMs)
const privacyToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(10) .settings-page__content-item-col > div'))
const securityTab = await findElement(driver, By.xpath(`//div[contains(text(), 'Security & Privacy')]`))
await securityTab.click()
await delay(regularDelayMs)
const privacyToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(1) .settings-page__content-item-col > div'))
await privacyToggle.click()
await delay(largeDelayMs * 2)
})
@ -472,15 +476,19 @@ describe('MetaMask', function () {
const settingsButton = await findElement(driver, By.xpath(`//div[contains(text(), 'Settings')]`))
settingsButton.click()
await findElement(driver, By.css('.tab-bar'))
// await findElement(driver, By.css('.tab-bar'))
const advancedTab = await findElement(driver, By.xpath(`//div[contains(text(), 'Advanced')]`))
await advancedTab.click()
await delay(regularDelayMs)
const showConversionToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(3) .settings-page__content-item-col > div'))
const showConversionToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(7) .settings-page__content-item-col > div'))
await showConversionToggle.click()
const advancedGasTitle = await findElement(driver, By.xpath(`//span[contains(text(), 'Advanced gas controls')]`))
await driver.executeScript('arguments[0].scrollIntoView(true)', advancedGasTitle)
const advancedGasToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(12) .settings-page__content-item-col > div'))
const advancedGasToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(5) .settings-page__content-item-col > div'))
await advancedGasToggle.click()
windowHandles = await driver.getAllWindowHandles()
extension = windowHandles[0]
@ -1053,7 +1061,6 @@ describe('MetaMask', function () {
const windowHandles = await driver.getAllWindowHandles()
const extension = windowHandles[0]
const dapp = await switchToWindowWithTitle(driver, 'E2E Test Dapp', windowHandles)
await closeAllWindowHandlesExcept(driver, [extension, dapp])
await delay(regularDelayMs)
await driver.switchTo().window(dapp)
@ -1062,7 +1069,6 @@ describe('MetaMask', function () {
const transferTokens = await findElement(driver, By.xpath(`//button[contains(text(), 'Transfer Tokens')]`))
await transferTokens.click()
await closeAllWindowHandlesExcept(driver, [extension, dapp])
await driver.switchTo().window(extension)
await delay(largeDelayMs)

@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('config view actions', function () {
var initialState = {

@ -2,8 +2,8 @@ const assert = require('assert')
const freeze = require('deep-freeze-strict')
const path = require('path')
const actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
const reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
const actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
const reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SET_ACCOUNT_LABEL', function () {
it('updates the state.metamask.identities[:i].name property of the state to the action.value.label', function () {

@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SET_SELECTED_ACCOUNT', function () {
it('sets the state.appState.activeAddress property of the state to the action.value', function () {

@ -4,7 +4,7 @@ var path = require('path')
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
const actions = require(path.join(__dirname, '../../../ui/app/actions.js'))
const actions = require(path.join(__dirname, '../../../ui/app/store/actions.js'))
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)

@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SHOW_INFO_PAGE', function () {
it('sets the state.appState.currentView.name property to info', function () {

@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('action DISPLAY_WARNING', function () {
it('sets appState.warning to provided value', function () {

@ -18,14 +18,9 @@ describe('', function () {
}
it('returns coinbase url with amount and address for network 1', function () {
const coinbaseUrl = getBuyEthUrl(mainnet)
const coinbase = coinbaseUrl.match(/(https:\/\/buy.coinbase.com)/)
const amount = coinbaseUrl.match(/(amount)\D\d/)
const address = coinbaseUrl.match(/(address)(.*)(?=&)/)
assert.equal(coinbase[0], 'https://buy.coinbase.com')
assert.equal(amount[0], 'amount=5')
assert.equal(address[0], 'address=0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
const wyreUrl = getBuyEthUrl(mainnet)
assert.equal(wyreUrl, 'https://dash.sendwyre.com/sign-up')
})

@ -1,6 +1,6 @@
const assert = require('assert')
const currencyFormatter = require('currency-formatter')
const infuraConversion = require('../../ui/app/infura-conversion.json')
const infuraConversion = require('../../ui/app/helpers/constants/infura-conversion.json')
describe('currencyFormatting', function () {
it('be able to format any infura currency', function (done) {

@ -4,8 +4,8 @@ var assert = require('assert')
var path = require('path')
var sinon = require('sinon')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('#unlockMetamask(selectedAccount)', function () {
beforeEach(function () {

@ -3,7 +3,7 @@ const assert = require('assert')
const h = require('react-hyperscript')
const sinon = require('sinon')
const path = require('path')
const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'dropdowns', 'index.js')).Dropdown
const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'app', 'dropdowns', 'index.js')).Dropdown
const { createMockStore } = require('redux-test-utils')
const { mountWithStore } = require('../../../lib/render-helpers')

@ -16,7 +16,7 @@ const { createTestProviderTools } = require('../../../stub/provider')
const provider = createTestProviderTools({ scaffold: {}}).provider
const enLocale = require('../../../../app/_locales/en/messages.json')
const actions = require('../../../../ui/app/actions')
const actions = require('../../../../ui/app/store/actions')
const MetaMaskController = require('../../../../app/scripts/metamask-controller')
const firstTimeState = require('../../../unit/localhostState')

@ -5,8 +5,8 @@ import { Provider } from 'react-redux'
import configureMockStore from 'redux-mock-store'
import { mount } from 'enzyme'
import TokenCell from '../../../../../ui/app/components/token-cell'
import Identicon from '../../../../../ui/app/components/identicon'
import TokenCell from '../../../../../ui/app/components/app/token-cell'
import Identicon from '../../../../../ui/app/components/ui/identicon'
describe('Token Cell', () => {
let wrapper

@ -1,6 +1,6 @@
import assert from 'assert'
import reduceApp from '../../../../../ui/app/reducers/app'
import * as actions from '../../../../../ui/app/actions'
import reduceApp from '../../../../../ui/app/ducks/app/app'
import * as actions from '../../../../../ui/app/store/actions'
describe('App State', () => {

@ -1,6 +1,6 @@
import assert from 'assert'
import reduceMetamask from '../../../../../ui/app/reducers/metamask'
import * as actions from '../../../../../ui/app/actions'
import reduceMetamask from '../../../../../ui/app/ducks/metamask/metamask'
import * as actions from '../../../../../ui/app/store/actions'
describe('MetaMask Reducers', () => {

@ -1,5 +1,5 @@
const assert = require('assert')
const selectors = require('../../../../ui/app/selectors')
const selectors = require('../../../../ui/app/selectors/selectors')
const mockState = require('../../../data/mock-state.json')
const Eth = require('ethjs')

@ -3,7 +3,7 @@ var sinon = require('sinon')
const ethUtil = require('ethereumjs-util')
var path = require('path')
var util = require(path.join(__dirname, '..', '..', 'ui', 'app', 'util.js'))
var util = require(path.join(__dirname, '..', '..', 'ui', 'app', 'helpers', 'utils', 'util.js'))
describe('util', function () {
var ethInWei = '1'

66
ui/.gitignore vendored

@ -1,66 +0,0 @@
# Created by https://www.gitignore.io/api/osx,node
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history

@ -1,87 +0,0 @@
const Component = require('react').Component
const h = require('react-hyperscript')
const PropTypes = require('prop-types')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
const { getCurrentViewContext } = require('../../selectors')
const classnames = require('classnames')
const NewAccountCreateForm = require('./create-form')
const NewAccountImportForm = require('../import')
function mapStateToProps (state) {
return {
displayedForm: getCurrentViewContext(state),
}
}
function mapDispatchToProps (dispatch) {
return {
displayForm: form => dispatch(actions.setNewAccountForm(form)),
showQrView: (selected, identity) => dispatch(actions.showQrView(selected, identity)),
showExportPrivateKeyModal: () => {
dispatch(actions.showModal({ name: 'EXPORT_PRIVATE_KEY' }))
},
hideModal: () => dispatch(actions.hideModal()),
setAccountLabel: (address, label) => dispatch(actions.setAccountLabel(address, label)),
}
}
inherits(AccountDetailsModal, Component)
function AccountDetailsModal (props) {
Component.call(this)
this.state = {
displayedForm: props.displayedForm,
}
}
AccountDetailsModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal)
AccountDetailsModal.prototype.render = function () {
const { displayedForm, displayForm } = this.props
return h('div.new-account', {}, [
h('div.new-account__header', [
h('div.new-account__title', this.context.t('newAccount')),
h('div.new-account__tabs', [
h('div.new-account__tabs__tab', {
className: classnames('new-account__tabs__tab', {
'new-account__tabs__selected': displayedForm === 'CREATE',
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'CREATE',
}),
onClick: () => displayForm('CREATE'),
}, this.context.t('createDen')),
h('div.new-account__tabs__tab', {
className: classnames('new-account__tabs__tab', {
'new-account__tabs__selected': displayedForm === 'IMPORT',
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'IMPORT',
}),
onClick: () => displayForm('IMPORT'),
}, this.context.t('import')),
]),
]),
h('div.new-account__form', [
displayedForm === 'CREATE'
? h(NewAccountCreateForm)
: h(NewAccountImportForm),
]),
])
}

@ -1,15 +1,15 @@
const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const actions = require('../actions')
const actions = require('../../store/actions')
const genAccountLink = require('etherscan-link').createAccountLink
const connect = require('react-redux').connect
const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const copyToClipboard = require('copy-to-clipboard')
const { checksumAddress } = require('../util')
const { checksumAddress } = require('../../helpers/utils/util')
import Identicon from './identicon'
import Identicon from '../ui/identicon'
class AccountDropdowns extends Component {
constructor (props) {

@ -2,12 +2,12 @@ import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import debounce from 'lodash.debounce'
import { Menu, Item, Divider, CloseArea } from '../dropdowns/components/menu'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../app/scripts/lib/util'
import Tooltip from '../tooltip'
import Identicon from '../identicon'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import Tooltip from '../../ui/tooltip'
import Identicon from '../../ui/identicon'
import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'
import { PRIMARY } from '../../constants/common'
import { PRIMARY } from '../../../helpers/constants/common'
import {
SETTINGS_ROUTE,
INFO_ROUTE,
@ -15,7 +15,7 @@ import {
IMPORT_ACCOUNT_ROUTE,
CONNECT_HARDWARE_ROUTE,
DEFAULT_ROUTE,
} from '../../routes'
} from '../../../helpers/constants/routes'
export default class AccountMenu extends PureComponent {
static contextTypes = {

@ -10,8 +10,8 @@ import {
showConfigPage,
showInfoPage,
showModal,
} from '../../actions'
import { getMetaMaskAccounts } from '../../selectors'
} from '../../../store/actions'
import { getMetaMaskAccounts } from '../../../selectors/selectors'
import AccountMenu from './account-menu.component'
function mapStateToProps (state) {

@ -1,9 +1,9 @@
const inherits = require('util').inherits
const Component = require('react').Component
const h = require('react-hyperscript')
import Identicon from './identicon'
const formatBalance = require('../util').formatBalance
const addressSummary = require('../util').addressSummary
import Identicon from '../ui/identicon'
const formatBalance = require('../../helpers/utils/util').formatBalance
const addressSummary = require('../../helpers/utils/util').addressSummary
module.exports = AccountPanel

@ -1,8 +1,8 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Identicon from '../identicon'
import { DEFAULT_ROUTE } from '../../routes'
import Identicon from '../../ui/identicon'
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes'
const NetworkIndicator = require('../network')
export default class AppHeader extends PureComponent {

@ -3,7 +3,7 @@ import { withRouter } from 'react-router-dom'
import { compose } from 'recompose'
import AppHeader from './app-header.component'
const actions = require('../../actions')
const actions = require('../../../store/actions')
const mapStateToProps = state => {
const { appState, metamask } = state

@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../actions')
const actions = require('../../store/actions')
CoinbaseForm.contextTypes = {
t: PropTypes.func,

@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display'
import { PRIMARY, SECONDARY } from '../../../constants/common'
import { PRIMARY, SECONDARY } from '../../../../helpers/constants/common'
const ConfirmDetailRow = props => {
const {

@ -1,9 +1,9 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { Tabs, Tab } from '../../tabs'
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from './'
import ErrorMessage from '../../error-message'
import { Tabs, Tab } from '../../../ui/tabs'
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
import ErrorMessage from '../../../ui/error-message'
export default class ConfirmPageContainerContent extends Component {
static propTypes = {

@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Identicon from '../../../identicon'
import Identicon from '../../../../ui/identicon'
const ConfirmPageContainerSummary = props => {
const {

@ -1,6 +1,6 @@
@import './confirm-page-container-warning/index';
@import 'confirm-page-container-warning/index';
@import './confirm-page-container-summary/index';
@import 'confirm-page-container-summary/index';
.confirm-page-container-content {
overflow-y: auto;

@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import {
ENVIRONMENT_TYPE_POPUP,
ENVIRONMENT_TYPE_NOTIFICATION,
} from '../../../../../app/scripts/lib/enums'
} from '../../../../../../app/scripts/lib/enums'
import NetworkDisplay from '../../network-display'
export default class ConfirmPageContainer extends Component {

@ -1,8 +1,8 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SenderToRecipient from '../sender-to-recipient'
import { PageContainerFooter } from '../page-container'
import { ConfirmPageContainerHeader, ConfirmPageContainerContent, ConfirmPageContainerNavigation } from './'
import SenderToRecipient from '../../ui/sender-to-recipient'
import { PageContainerFooter } from '../../ui/page-container'
import { ConfirmPageContainerHeader, ConfirmPageContainerContent, ConfirmPageContainerNavigation } from '.'
export default class ConfirmPageContainer extends Component {
static contextTypes = {

@ -0,0 +1,7 @@
@import 'confirm-page-container-content/index';
@import 'confirm-page-container-header/index';
@import 'confirm-detail-row/index';
@import 'confirm-page-container-navigation/index';

@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const Tooltip = require('./tooltip')
const Tooltip = require('../ui/tooltip')
const copyToClipboard = require('copy-to-clipboard')
const connect = require('react-redux').connect

@ -4,15 +4,15 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const BigNumber = require('bignumber.js')
const actions = require('../../actions')
const actions = require('../../../store/actions')
const GasModalCard = require('./gas-modal-card')
import Button from '../button'
import Button from '../../ui/button'
const ethUtil = require('ethereumjs-util')
import {
updateSendErrors,
} from '../../ducks/send.duck'
} from '../../../ducks/send/send.duck'
const {
MIN_GAS_PRICE_DEC,
@ -30,7 +30,7 @@ const {
conversionGreaterThan,
conversionMax,
subtractCurrencies,
} = require('../../conversion-util')
} = require('../../../helpers/utils/conversion-util')
const {
getGasIsLoading,
@ -42,7 +42,7 @@ const {
getCurrentAccountWithSendEtherInfo,
getSelectedTokenToFiatRate,
getSendMaxModeState,
} = require('../../selectors')
} = require('../../../selectors/selectors')
const {
getGasPrice,

@ -3,9 +3,9 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
const { getSelectedIdentity } = require('../../selectors')
const genAccountLink = require('../../../lib/account-link.js')
const actions = require('../../../store/actions')
const { getSelectedIdentity } = require('../../../selectors/selectors')
const genAccountLink = require('../../../../lib/account-link.js')
const { Menu, Item, CloseArea } = require('./components/menu')
AccountDetailsDropdown.contextTypes = {

@ -1,15 +1,15 @@
const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const actions = require('../../../actions')
const genAccountLink = require('../../../../lib/account-link.js')
const actions = require('../../../../store/actions')
const genAccountLink = require('../../../../../lib/account-link.js')
const connect = require('react-redux').connect
const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem
import Identicon from '../../identicon'
const { checksumAddress } = require('../../../util')
import Identicon from '../../../ui/identicon'
const { checksumAddress } = require('../../../../helpers/utils/util')
const copyToClipboard = require('copy-to-clipboard')
const { formatBalance } = require('../../../util')
const { formatBalance } = require('../../../../helpers/utils/util')
class AccountDropdowns extends Component {

@ -5,12 +5,12 @@ const inherits = require('util').inherits
const connect = require('react-redux').connect
const { withRouter } = require('react-router-dom')
const { compose } = require('recompose')
const actions = require('../../actions')
const actions = require('../../../store/actions')
const Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
const NetworkDropdownIcon = require('./components/network-dropdown-icon')
const R = require('ramda')
const { SETTINGS_ROUTE } = require('../../routes')
const { ADVANCED_ROUTE } = require('../../../helpers/constants/routes')
// classes from nodes of the toggle element.
const notToggleElementClassnames = [
@ -233,7 +233,7 @@ NetworkDropdown.prototype.render = function () {
DropdownMenuItem,
{
closeMenu: () => this.props.hideNetworkDropdown(),
onClick: () => this.props.history.push(SETTINGS_ROUTE),
onClick: () => this.props.history.push(ADVANCED_ROUTE),
style: dropdownMenuItemStyle,
},
[

@ -1,7 +1,7 @@
import React from 'react'
import assert from 'assert'
import { createMockStore } from 'redux-test-utils'
import { mountWithRouter } from '../../../../../test/lib/render-helpers'
import { mountWithRouter } from '../../../../../../test/lib/render-helpers'
import NetworkDropdown from '../network-dropdown'
import { DropdownMenuItem } from '../components/dropdown'
import NetworkDropdownIcon from '../components/network-dropdown-icon'

@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const connect = require('react-redux').connect
const actions = require('../../actions')
const actions = require('../../../store/actions')
const genAccountLink = require('etherscan-link').createAccountLink
const { Menu, Item, CloseArea } = require('./components/menu')

@ -12,7 +12,7 @@ const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const connect = require('react-redux').connect
const ToAutoComplete = require('./send/to-autocomplete').default
const log = require('loglevel')
const { isValidENSAddress } = require('../util')
const { isValidENSAddress } = require('../../helpers/utils/util')
EnsInput.contextTypes = {
t: PropTypes.func,

@ -1,10 +1,10 @@
import { connect } from 'react-redux'
import { showModal } from '../../../actions'
import { showModal } from '../../../../store/actions'
import {
decGWEIToHexWEI,
decimalToHex,
hexWEIToDecGWEI,
} from '../../../helpers/conversions.util'
} from '../../../../helpers/utils/conversions.util'
import AdvancedGasInputs from './advanced-gas-inputs.component'
function convertGasPriceForInputs (gasPriceInHexWEI) {

@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import Loading from '../../../loading-screen'
import Loading from '../../../../ui/loading-screen'
import GasPriceChart from '../../gas-price-chart'
import debounce from 'lodash.debounce'
@ -23,6 +23,7 @@ export default class AdvancedTabContent extends Component {
insufficientBalance: PropTypes.bool,
customPriceIsSafe: PropTypes.bool,
isSpeedUp: PropTypes.bool,
isEthereumNetwork: PropTypes.bool,
}
constructor (props) {
@ -188,6 +189,7 @@ export default class AdvancedTabContent extends Component {
customPriceIsSafe,
isSpeedUp,
transactionFee,
isEthereumNetwork,
} = this.props
return (
@ -203,15 +205,20 @@ export default class AdvancedTabContent extends Component {
customPriceIsSafe,
isSpeedUp,
}) }
<div className="advanced-tab__fee-chart__title">{ t('liveGasPricePredictions') }</div>
{!gasEstimatesLoading
? <GasPriceChart {...gasChartProps} updateCustomGasPrice={updateCustomGasPrice} />
: <Loading />
{ isEthereumNetwork
? <div>
<div className="advanced-tab__fee-chart__title">{ t('liveGasPricePredictions') }</div>
{!gasEstimatesLoading
? <GasPriceChart {...gasChartProps} updateCustomGasPrice={updateCustomGasPrice} />
: <Loading />
}
<div className="advanced-tab__fee-chart__speed-buttons">
<span>{ t('slower') }</span>
<span>{ t('faster') }</span>
</div>
</div>
: <div className="advanced-tab__fee-chart__title">{ t('chartOnlyAvailableEth') }</div>
}
<div className="advanced-tab__fee-chart__speed-buttons">
<span>{ t('slower') }</span>
<span>{ t('faster') }</span>
</div>
</div>
</div>
)

@ -1,11 +1,11 @@
import React from 'react'
import assert from 'assert'
import shallow from '../../../../../../lib/shallow-with-context'
import shallow from '../../../../../../../lib/shallow-with-context'
import sinon from 'sinon'
import AdvancedTabContent from '../advanced-tab-content.component.js'
import GasPriceChart from '../../../gas-price-chart'
import Loading from '../../../../loading-screen'
import Loading from '../../../../../ui/loading-screen'
const propsMethodSpies = {
updateCustomGasPrice: sinon.spy(),
@ -32,6 +32,7 @@ describe('AdvancedTabContent Component', function () {
insufficientBalance={false}
customPriceIsSafe={true}
isSpeedUp={false}
isEthereumNetwork={true}
/>, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
})
@ -59,9 +60,9 @@ describe('AdvancedTabContent Component', function () {
const feeChartDiv = advancedTabChildren.at(1)
assert(feeChartDiv.childAt(0).hasClass('advanced-tab__gas-edit-rows'))
assert(feeChartDiv.childAt(1).hasClass('advanced-tab__fee-chart__title'))
assert(feeChartDiv.childAt(2).is(GasPriceChart))
assert(feeChartDiv.childAt(3).hasClass('advanced-tab__fee-chart__speed-buttons'))
assert(feeChartDiv.childAt(1).childAt(0).hasClass('advanced-tab__fee-chart__title'))
assert(feeChartDiv.childAt(1).childAt(1).is(GasPriceChart))
assert(feeChartDiv.childAt(1).childAt(2).hasClass('advanced-tab__fee-chart__speed-buttons'))
})
it('should render a loading component instead of the chart if gasEstimatesLoading is true', () => {
@ -75,9 +76,9 @@ describe('AdvancedTabContent Component', function () {
const feeChartDiv = advancedTabChildren.at(1)
assert(feeChartDiv.childAt(0).hasClass('advanced-tab__gas-edit-rows'))
assert(feeChartDiv.childAt(1).hasClass('advanced-tab__fee-chart__title'))
assert(feeChartDiv.childAt(2).is(Loading))
assert(feeChartDiv.childAt(3).hasClass('advanced-tab__fee-chart__speed-buttons'))
assert(feeChartDiv.childAt(1).childAt(0).hasClass('advanced-tab__fee-chart__title'))
assert(feeChartDiv.childAt(1).childAt(1).is(Loading))
assert(feeChartDiv.childAt(1).childAt(2).hasClass('advanced-tab__fee-chart__speed-buttons'))
})
it('should call renderDataSummary with the expected params', () => {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save