From dedf0494adfd712026d1aa1cc5a7a3922156f71b Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Mon, 31 Dec 2018 16:16:34 -0500 Subject: [PATCH 01/16] Dont use sudo to install truffle --- test/e2e/beta/run-drizzle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index 609f2765ecc7..6e4602d00217 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,7 +7,7 @@ sleep 5 cd test/e2e/beta/ rm -rf drizzle-test mkdir drizzle-test && cd drizzle-test -sudo npm install -g truffle +npm install -g truffle truffle unbox drizzle echo "Deploying contracts for Drizzle test..." truffle compile && truffle migrate From 4f203e28e10f5da4719636b2f5a0760ac4ee03c9 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 2 Jan 2019 16:18:24 -0500 Subject: [PATCH 02/16] --unsafe-perm ? --- test/e2e/beta/run-drizzle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index 6e4602d00217..7f474b41881b 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,7 +7,7 @@ sleep 5 cd test/e2e/beta/ rm -rf drizzle-test mkdir drizzle-test && cd drizzle-test -npm install -g truffle +sudo npm install --unsafe-perm -g truffle truffle unbox drizzle echo "Deploying contracts for Drizzle test..." truffle compile && truffle migrate From 92dc8eae48f788c75be0de36a0eddafe65668ec3 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 2 Jan 2019 16:29:33 -0500 Subject: [PATCH 03/16] Use sudo consistently --- test/e2e/beta/run-drizzle.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index 7f474b41881b..bac57a0980e8 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -8,9 +8,9 @@ cd test/e2e/beta/ rm -rf drizzle-test mkdir drizzle-test && cd drizzle-test sudo npm install --unsafe-perm -g truffle -truffle unbox drizzle +sudo truffle unbox drizzle echo "Deploying contracts for Drizzle test..." -truffle compile && truffle migrate +sudo truffle compile && sudo truffle migrate BROWSER=none npm start >> /dev/null 2>&1 & cd ../../../../ mocha test/e2e/beta/drizzle.spec From 134ad1ffaf7c128e5746ad08b794ef21857f4581 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 2 Jan 2019 17:17:44 -0500 Subject: [PATCH 04/16] no globals --- test/e2e/beta/run-drizzle.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index bac57a0980e8..a16c795a6de9 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,10 +7,10 @@ sleep 5 cd test/e2e/beta/ rm -rf drizzle-test mkdir drizzle-test && cd drizzle-test -sudo npm install --unsafe-perm -g truffle -sudo truffle unbox drizzle +npm install --unsafe-perm truffle +../../../../node_modules/.bin/truffle unbox drizzle echo "Deploying contracts for Drizzle test..." -sudo truffle compile && sudo truffle migrate +../../../../node_modules/.bin/truffle compile && ../../../../node_modules/.bin/truffle migrate BROWSER=none npm start >> /dev/null 2>&1 & cd ../../../../ mocha test/e2e/beta/drizzle.spec From a82b109737626d81b19e518e0fa746384da37282 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 2 Jan 2019 17:28:26 -0500 Subject: [PATCH 05/16] remove --unsafe-perm --- test/e2e/beta/run-drizzle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index a16c795a6de9..09b903afb7b3 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,7 +7,7 @@ sleep 5 cd test/e2e/beta/ rm -rf drizzle-test mkdir drizzle-test && cd drizzle-test -npm install --unsafe-perm truffle +npm install truffle ../../../../node_modules/.bin/truffle unbox drizzle echo "Deploying contracts for Drizzle test..." ../../../../node_modules/.bin/truffle compile && ../../../../node_modules/.bin/truffle migrate From 47d7771de451695f43489ea1606691c57fdda683 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Wed, 2 Jan 2019 19:03:35 -0500 Subject: [PATCH 06/16] fix extension link --- app/scripts/platforms/extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 55240ef1a589..e8779739cd0f 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -111,7 +111,7 @@ class ExtensionPlatform { _viewOnEtherScan (txId) { if (txId.startsWith('http://')) { - this.openWindow({ url: txId }) + extension.tabs.create({ url: txId }) } } } From d0bab5c1495f4260a7d684ad744978844adca506 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Fri, 21 Dec 2018 13:44:27 -0300 Subject: [PATCH 07/16] show lower case addresses when chainId is rsk --- .../components/modals/account-details-modal.js | 1 + ui/app/components/qr-code.js | 16 ++++++++++++---- .../selected-account.component.js | 13 ++++++++----- .../selected-account.container.js | 7 ++++--- ui/app/components/wallet-view.js | 10 +++++++--- ui/app/util.js | 11 +++++++++++ 6 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index 248ffe008639..cd9e4a9eceb7 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -77,6 +77,7 @@ AccountDetailsModal.prototype.render = function () { h(QrView, { Qr: { data: address, + network: network }, }), diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index d3242ddf5f85..8c5756985142 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -5,11 +5,12 @@ const inherits = require('util').inherits const connect = require('react-redux').connect const { isHexPrefixed } = require('ethereumjs-util') const ReadOnlyInput = require('./readonly-input') -const { checksumAddress } = require('../util') +const { checksumAddress, isRskNetwork } = require('../util') module.exports = connect(mapStateToProps)(QrCodeView) function mapStateToProps (state) { + return { // Qr code is not fetched from state. 'message' and 'data' props are passed instead. buyView: state.appState.buyView, @@ -25,9 +26,16 @@ function QrCodeView () { QrCodeView.prototype.render = function () { const props = this.props - const { message, data } = props.Qr - const address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data)}` + const { message, data, network} = props.Qr + + let address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data)}` + if (isRskNetwork(network)){ + address = `${isHexPrefixed(data) ? 'rsk:' : ''}${checksumAddress(data).toLowerCase()}` + } + debugger; + const qrImage = qrCode(4, 'M') + qrImage.addData(address) qrImage.make() @@ -51,7 +59,7 @@ QrCodeView.prototype.render = function () { h(ReadOnlyInput, { wrapperClass: 'ellip-address-wrapper', inputClass: 'qr-ellip-address', - value: checksumAddress(data), + value: isRskNetwork(network) ? data.toLowerCase() : checksumAddress(data), }), ]) } diff --git a/ui/app/components/selected-account/selected-account.component.js b/ui/app/components/selected-account/selected-account.component.js index 4f98df9b6ee4..a6ea32a1dd9e 100644 --- a/ui/app/components/selected-account/selected-account.component.js +++ b/ui/app/components/selected-account/selected-account.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import copyToClipboard from 'copy-to-clipboard' -import { addressSlicer, checksumAddress } from '../../util' +import { addressSlicer, checksumAddress, isRskNetwork } from '../../util' const Tooltip = require('../tooltip-v2.js').default @@ -14,16 +14,19 @@ class SelectedAccount extends Component { t: PropTypes.func, } - static propTypes = { + static propTypes = { selectedAddress: PropTypes.string, selectedIdentity: PropTypes.object, + network: PropTypes.string, } render () { const { t } = this.context - const { selectedAddress, selectedIdentity } = this.props - const checksummedAddress = checksumAddress(selectedAddress) - + const { selectedAddress, selectedIdentity, network } = this.props + let checksummedAddress = checksumAddress(selectedAddress) + if (isRskNetwork(network)) { + checksummedAddress = checksummedAddress.toLowerCase() + } return (
{ - return { + return { selectedAddress: selectors.getSelectedAddress(state), selectedIdentity: selectors.getSelectedIdentity(state), - } + network: state.metamask.network, + } } -export default connect(mapStateToProps)(SelectedAccount) +export default connect(mapStateToProps)(SelectedAccount) \ No newline at end of file diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 8ad6637ae7ab..973aed8eef50 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -6,7 +6,7 @@ const { withRouter } = require('react-router-dom') const { compose } = require('recompose') const inherits = require('util').inherits const classnames = require('classnames') -const { checksumAddress } = require('../util') +const { checksumAddress, isRskNetwork} = require('../util') import Identicon from './identicon' // const AccountDropdowns = require('./dropdowns/index.js').AccountDropdowns const Tooltip = require('./tooltip-v2.js').default @@ -125,10 +125,14 @@ WalletView.prototype.render = function () { showAccountDetailModal, hideSidebar, identities, + network, } = this.props // temporary logs + fake extra wallets - const checksummedAddress = checksumAddress(selectedAddress) + let checksummedAddress = checksumAddress(selectedAddress) + if (isRskNetwork(network)){ + checksummedAddress = checksumAddress(selectedAddress).toLowerCase() + } if (!selectedAddress) { throw new Error('selectedAddress should not be ' + String(selectedAddress)) @@ -194,7 +198,7 @@ WalletView.prototype.render = function () { className: classnames({ 'wallet-view__address__pressed': this.state.copyToClipboardPressed, }), - onClick: () => { + onClick: () => { copyToClipboard(checksummedAddress) this.setState({ hasCopied: true }) setTimeout(() => this.setState({ hasCopied: false }), 3000) diff --git a/ui/app/util.js b/ui/app/util.js index 31757e7c3d4b..847224455e27 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -60,8 +60,19 @@ module.exports = { getTokenAddressFromTokenObject, checksumAddress, addressSlicer, + isRskNetwork } +function isRskNetwork(networkChainId){ + if (!networkChainId) return false + if (networkChainId == '30' || networkChainId == '31'){ + return true + } + + return false; +} + + function valuesFor (obj) { if (!obj) return [] return Object.keys(obj) From f9ef43fa898bfd03d472bec3dde13f18d941ddbc Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Wed, 26 Dec 2018 18:11:37 -0300 Subject: [PATCH 08/16] Changed SendToRow component to convert to lower case the destination address if network is RSK --- .../send-content/send-to-row/send-to-row.component.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/app/components/send/send-content/send-to-row/send-to-row.component.js b/ui/app/components/send/send-content/send-to-row/send-to-row.component.js index ce5325314d0b..e05d360fc3ee 100644 --- a/ui/app/components/send/send-content/send-to-row/send-to-row.component.js +++ b/ui/app/components/send/send-content/send-to-row/send-to-row.component.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import SendRowWrapper from '../send-row-wrapper/' import EnsInput from '../../../ens-input' import { getToErrorObject } from './send-to-row.utils.js' +import { isRskNetwork } from '../../../../util' export default class SendToRow extends Component { @@ -25,7 +26,12 @@ export default class SendToRow extends Component { t: PropTypes.func, } - handleToChange (to, nickname = '', toError) { + handleToChange (to, nickname = '', toError, network) { + + if (isRskNetwork(network)){ + to = to.toLowerCase(); + } + const { hasHexData, updateSendTo, updateSendToError, updateGas } = this.props const toErrorObject = getToErrorObject(to, toError, hasHexData) updateSendTo(to, nickname) @@ -47,6 +53,7 @@ export default class SendToRow extends Component { } = this.props return ( + this.handleToChange(toAddress, nickname, toError)} + onChange={({ toAddress, nickname, toError }) => this.handleToChange(toAddress, nickname, toError, this.props.network)} openDropdown={() => openToDropdown()} placeholder={this.context.t('recipientAddress')} to={to} From 8d050cfc9a319cdbf05fc11eae5db061fb464288 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Thu, 27 Dec 2018 13:50:56 -0300 Subject: [PATCH 09/16] Remove debbuger --- ui/app/components/qr-code.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index 8c5756985142..d63d84f7809c 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -31,8 +31,7 @@ QrCodeView.prototype.render = function () { let address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data)}` if (isRskNetwork(network)){ address = `${isHexPrefixed(data) ? 'rsk:' : ''}${checksumAddress(data).toLowerCase()}` - } - debugger; + } const qrImage = qrCode(4, 'M') From 3496f355bae97395f3efdd6edd00fc17eaf965e2 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Thu, 27 Dec 2018 16:34:30 -0300 Subject: [PATCH 10/16] Added changes in CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index becbae3e27b6..f2a5220df491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - [#5932](https://github.com/MetaMask/metamask-extension/pull/5932): Fix displayed time and date in the activity log. Remove vreme library, add luxon library. - [#5924](https://github.com/MetaMask/metamask-extension/pull/5924): transactions - throw an error if a transaction is generated while the network is loading - [#5893](https://github.com/MetaMask/metamask-extension/pull/5893): Add loading network screen +- [#5973] (https://github.com/MetaMask/metamask-extension/pull/5973): Fix incorrectly showing checksums on non-ETH blockchains (issue 5838) ## 5.2.2 Wed Dec 12 2018 From 840a95af6661919d3b15bfc1779082f54c4986c2 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Thu, 27 Dec 2018 17:31:32 -0300 Subject: [PATCH 11/16] Fixed lint validation errors --- ui/app/components/modals/account-details-modal.js | 2 +- ui/app/components/qr-code.js | 8 +++----- .../selected-account/selected-account.component.js | 4 ++-- .../selected-account/selected-account.container.js | 6 +++--- .../send-content/send-to-row/send-to-row.component.js | 7 ++----- ui/app/components/wallet-view.js | 4 ++-- ui/app/util.js | 9 ++++----- 7 files changed, 17 insertions(+), 23 deletions(-) diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index cd9e4a9eceb7..67d8eb0fdaaf 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -77,7 +77,7 @@ AccountDetailsModal.prototype.render = function () { h(QrView, { Qr: { data: address, - network: network + network: network, }, }), diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index d63d84f7809c..1a506635683a 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -26,13 +26,11 @@ function QrCodeView () { QrCodeView.prototype.render = function () { const props = this.props - const { message, data, network} = props.Qr - + const { message, data, network } = props.Qr let address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data)}` - if (isRskNetwork(network)){ + if (isRskNetwork(network)) { address = `${isHexPrefixed(data) ? 'rsk:' : ''}${checksumAddress(data).toLowerCase()}` - } - + } const qrImage = qrCode(4, 'M') qrImage.addData(address) diff --git a/ui/app/components/selected-account/selected-account.component.js b/ui/app/components/selected-account/selected-account.component.js index a6ea32a1dd9e..3579c35d46f1 100644 --- a/ui/app/components/selected-account/selected-account.component.js +++ b/ui/app/components/selected-account/selected-account.component.js @@ -14,7 +14,7 @@ class SelectedAccount extends Component { t: PropTypes.func, } - static propTypes = { + static propTypes = { selectedAddress: PropTypes.string, selectedIdentity: PropTypes.object, network: PropTypes.string, @@ -22,7 +22,7 @@ class SelectedAccount extends Component { render () { const { t } = this.context - const { selectedAddress, selectedIdentity, network } = this.props + const { selectedAddress, selectedIdentity, network } = this.props let checksummedAddress = checksumAddress(selectedAddress) if (isRskNetwork(network)) { checksummedAddress = checksummedAddress.toLowerCase() diff --git a/ui/app/components/selected-account/selected-account.container.js b/ui/app/components/selected-account/selected-account.container.js index a82414c2f49a..1c8d17d8d8ac 100644 --- a/ui/app/components/selected-account/selected-account.container.js +++ b/ui/app/components/selected-account/selected-account.container.js @@ -4,11 +4,11 @@ import SelectedAccount from './selected-account.component' const selectors = require('../../selectors') const mapStateToProps = state => { - return { + return { selectedAddress: selectors.getSelectedAddress(state), selectedIdentity: selectors.getSelectedIdentity(state), network: state.metamask.network, - } + } } -export default connect(mapStateToProps)(SelectedAccount) \ No newline at end of file +export default connect(mapStateToProps)(SelectedAccount) diff --git a/ui/app/components/send/send-content/send-to-row/send-to-row.component.js b/ui/app/components/send/send-content/send-to-row/send-to-row.component.js index e05d360fc3ee..fd7ff652164c 100644 --- a/ui/app/components/send/send-content/send-to-row/send-to-row.component.js +++ b/ui/app/components/send/send-content/send-to-row/send-to-row.component.js @@ -27,11 +27,9 @@ export default class SendToRow extends Component { } handleToChange (to, nickname = '', toError, network) { - - if (isRskNetwork(network)){ - to = to.toLowerCase(); + if (isRskNetwork(network)) { + to = to.toLowerCase() } - const { hasHexData, updateSendTo, updateSendToError, updateGas } = this.props const toErrorObject = getToErrorObject(to, toError, hasHexData) updateSendTo(to, nickname) @@ -53,7 +51,6 @@ export default class SendToRow extends Component { } = this.props return ( - { + onClick: () => { copyToClipboard(checksummedAddress) this.setState({ hasCopied: true }) setTimeout(() => this.setState({ hasCopied: false }), 3000) diff --git a/ui/app/util.js b/ui/app/util.js index 847224455e27..81bb918b3dda 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -60,19 +60,18 @@ module.exports = { getTokenAddressFromTokenObject, checksumAddress, addressSlicer, - isRskNetwork + isRskNetwork, } -function isRskNetwork(networkChainId){ +function isRskNetwork (networkChainId) { if (!networkChainId) return false - if (networkChainId == '30' || networkChainId == '31'){ + if (networkChainId === '30' || networkChainId === '31') { return true } - return false; + return false } - function valuesFor (obj) { if (!obj) return [] return Object.keys(obj) From 495873242f3e845aaab53327be97f940f7da0e72 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Thu, 27 Dec 2018 17:51:01 -0300 Subject: [PATCH 12/16] Fix send-to-row-component.test.js --- .../send-to-row/tests/send-to-row-component.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js b/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js index 591229deb0ac..5d8a8e8741df 100644 --- a/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js +++ b/ui/app/components/send/send-content/send-to-row/tests/send-to-row-component.test.js @@ -142,7 +142,7 @@ describe('SendToRow Component', function () { assert.equal(SendToRow.prototype.handleToChange.callCount, 1) assert.deepEqual( SendToRow.prototype.handleToChange.getCall(0).args, - ['mockNewTo', 'mockNewNickname', 'mockToError'] + ['mockNewTo', 'mockNewNickname', 'mockToError', 'mockNetwork' ] ) }) }) From 4056a2f6e54d9536345c73895d63c54d8dcb7e53 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Fri, 4 Jan 2019 14:56:06 -0300 Subject: [PATCH 13/16] Improvement in checksums logic on non eth networks --- ui/app/components/qr-code.js | 9 ++--- .../selected-account.component.js | 8 ++--- .../send-to-row/send-to-row.component.js | 6 ++-- ui/app/components/wallet-view.js | 8 ++--- ui/app/util.js | 33 +++++++++++++++---- 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index 1a506635683a..f3bf4638fb16 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -5,7 +5,7 @@ const inherits = require('util').inherits const connect = require('react-redux').connect const { isHexPrefixed } = require('ethereumjs-util') const ReadOnlyInput = require('./readonly-input') -const { checksumAddress, isRskNetwork } = require('../util') +const { checksumAddress } = require('../util') module.exports = connect(mapStateToProps)(QrCodeView) @@ -27,10 +27,7 @@ function QrCodeView () { QrCodeView.prototype.render = function () { const props = this.props const { message, data, network } = props.Qr - let address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data)}` - if (isRskNetwork(network)) { - address = `${isHexPrefixed(data) ? 'rsk:' : ''}${checksumAddress(data).toLowerCase()}` - } + const address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${checksumAddress(data, network)}` const qrImage = qrCode(4, 'M') qrImage.addData(address) @@ -56,7 +53,7 @@ QrCodeView.prototype.render = function () { h(ReadOnlyInput, { wrapperClass: 'ellip-address-wrapper', inputClass: 'qr-ellip-address', - value: isRskNetwork(network) ? data.toLowerCase() : checksumAddress(data), + value: checksumAddress(data, network), }), ]) } diff --git a/ui/app/components/selected-account/selected-account.component.js b/ui/app/components/selected-account/selected-account.component.js index 3579c35d46f1..47c56e312678 100644 --- a/ui/app/components/selected-account/selected-account.component.js +++ b/ui/app/components/selected-account/selected-account.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import copyToClipboard from 'copy-to-clipboard' -import { addressSlicer, checksumAddress, isRskNetwork } from '../../util' +import { addressSlicer, checksumAddress } from '../../util' const Tooltip = require('../tooltip-v2.js').default @@ -23,10 +23,8 @@ class SelectedAccount extends Component { render () { const { t } = this.context const { selectedAddress, selectedIdentity, network } = this.props - let checksummedAddress = checksumAddress(selectedAddress) - if (isRskNetwork(network)) { - checksummedAddress = checksummedAddress.toLowerCase() - } + const checksummedAddress = checksumAddress(selectedAddress, network) + return (
Date: Mon, 31 Dec 2018 16:16:34 -0500 Subject: [PATCH 14/16] Dont use sudo to install truffle --- test/e2e/beta/run-drizzle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index 0799b5a65540..a5d77d5053a1 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -28,4 +28,4 @@ fi ! kill -15 $npm_run_ganache_start_pid ! kill -15 $npm_start_pid ! wait $npm_run_ganache_start_pid $npm_start_pid -exit ${test_status:-} +exit ${test_status:-} \ No newline at end of file From c3f680c44634169484ef987b5c4a249fa8911e34 Mon Sep 17 00:00:00 2001 From: Bruno Barbieri Date: Wed, 2 Jan 2019 17:17:44 -0500 Subject: [PATCH 15/16] no globals --- test/e2e/beta/run-drizzle.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index a5d77d5053a1..eb5021673e9f 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,6 +7,7 @@ set -o pipefail npm run ganache:start -- -b 2 >> /dev/null 2>&1 & npm_run_ganache_start_pid=$! sleep 5 +<<<<<<< HEAD pushd "$(mktemp -d)" npm install --no-package-lock truffle @@ -16,6 +17,15 @@ echo "Deploying contracts for Drizzle test..." $truffle compile $truffle migrate +======= +cd test/e2e/beta/ +rm -rf drizzle-test +mkdir drizzle-test && cd drizzle-test +npm install --unsafe-perm truffle +../../../../node_modules/.bin/truffle unbox drizzle +echo "Deploying contracts for Drizzle test..." +../../../../node_modules/.bin/truffle compile && ../../../../node_modules/.bin/truffle migrate +>>>>>>> no globals BROWSER=none npm start >> /dev/null 2>&1 & npm_start_pid=$! From 2466f7636ba4e13c8b4164f0f0b39b5edcb52678 Mon Sep 17 00:00:00 2001 From: jonathansmirnoff Date: Fri, 4 Jan 2019 19:58:12 -0300 Subject: [PATCH 16/16] Fix merge issues --- test/e2e/beta/run-drizzle.sh | 10 ---------- ui/app/util.js | 18 ------------------ 2 files changed, 28 deletions(-) diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh index eb5021673e9f..a5d77d5053a1 100755 --- a/test/e2e/beta/run-drizzle.sh +++ b/test/e2e/beta/run-drizzle.sh @@ -7,7 +7,6 @@ set -o pipefail npm run ganache:start -- -b 2 >> /dev/null 2>&1 & npm_run_ganache_start_pid=$! sleep 5 -<<<<<<< HEAD pushd "$(mktemp -d)" npm install --no-package-lock truffle @@ -17,15 +16,6 @@ echo "Deploying contracts for Drizzle test..." $truffle compile $truffle migrate -======= -cd test/e2e/beta/ -rm -rf drizzle-test -mkdir drizzle-test && cd drizzle-test -npm install --unsafe-perm truffle -../../../../node_modules/.bin/truffle unbox drizzle -echo "Deploying contracts for Drizzle test..." -../../../../node_modules/.bin/truffle compile && ../../../../node_modules/.bin/truffle migrate ->>>>>>> no globals BROWSER=none npm start >> /dev/null 2>&1 & npm_start_pid=$! diff --git a/ui/app/util.js b/ui/app/util.js index 25146310624c..702b4dd320f3 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -63,24 +63,6 @@ module.exports = { isEthNetwork, } -/* - case 'mainnet': - netId = '1' - chainId = '0x01' - break - case 'ropsten': - netId = '3' - chainId = '0x03' - break - case 'rinkeby': - netId = '4' - chainId = '0x04' - break - case 'kovan': - netId = '42' - chainId = '0x2a' - break*/ - function isEthNetwork (netId) { if (!netId) return false