aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Bouchon <mail@bitpshr.net>2018-09-18 00:11:10 +0800
committerGitHub <noreply@github.com>2018-09-18 00:11:10 +0800
commitdaca7f9b41d784a44c7f5469b8f9b710e0a08e4b (patch)
treef00bcf3853428dc785024bc07564d1f02c061c3e
parent42fdcf6239fc9278cfa85b6ae6cc025cef0e35ae (diff)
parent2f14f978e390772e78e4cc2ee7a778c9106d053c (diff)
downloadtangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.gz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.bz2
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.lz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.xz
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.tar.zst
tangerine-wallet-browser-daca7f9b41d784a44c7f5469b8f9b710e0a08e4b.zip
Merge branch 'develop' into eip-712
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/inpage.js19
-rw-r--r--ui/app/components/input-number.js13
-rw-r--r--ui/app/components/pages/create-account/import-account/json.js2
-rw-r--r--ui/app/components/selected-account/selected-account.component.js7
-rw-r--r--ui/app/components/selected-account/tests/selected-account-component.test.js16
-rw-r--r--ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js12
-rw-r--r--ui/app/components/transaction-list-item/transaction-list-item.component.js5
-rw-r--r--ui/app/css/itcss/components/send.scss17
9 files changed, 74 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66999f1b0..3f3fe4108 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
- [#4606](https://github.com/MetaMask/metamask-extension/pull/4606): Add new metamask_watchAsset method.
- [#5189](https://github.com/MetaMask/metamask-extension/pull/5189): Fix bug where Ropsten loading message is shown when connecting to Kovan.
- [#4752](https://github.com/MetaMask/metamask-extension/issues/4752): Implement latest `eth_signTypedData` specification.
+- [#5256](https://github.com/MetaMask/metamask-extension/pull/5256): Add mock EIP-1102 support
## 4.9.3 Wed Aug 15 2018
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 1a170c617..d9fda1feb 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -22,6 +22,25 @@ var metamaskStream = new LocalMessageDuplexStream({
// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)
+// Augment the provider with its enable method
+inpageProvider.enable = function (options = {}) {
+ return new Promise((resolve, reject) => {
+ if (options.mockRejection) {
+ reject('User rejected account access')
+ } else {
+ inpageProvider.sendAsync({ method: 'eth_accounts', params: [] }, (error, response) => {
+ if (error) {
+ reject(error)
+ } else {
+ resolve(response.result)
+ }
+ })
+ }
+ })
+}
+
+window.ethereum = inpageProvider
+
//
// setup web3
//
diff --git a/ui/app/components/input-number.js b/ui/app/components/input-number.js
index 59c6842ef..eec5e3740 100644
--- a/ui/app/components/input-number.js
+++ b/ui/app/components/input-number.js
@@ -66,13 +66,16 @@ InputNumber.prototype.render = function () {
}),
h('span.gas-tooltip-input-detail', {}, [unitLabel]),
h('div.gas-tooltip-input-arrows', {}, [
- h('i.fa.fa-angle-up', {
+ h('div.gas-tooltip-input-arrow-wrapper', {
onClick: () => this.setValue(addCurrencies(value, step, { toNumericBase: 'dec' })),
- }),
- h('i.fa.fa-angle-down', {
- style: { cursor: 'pointer' },
+ }, [
+ h('i.fa.fa-angle-up'),
+ ]),
+ h('div.gas-tooltip-input-arrow-wrapper', {
onClick: () => this.setValue(subtractCurrencies(value, step, { toNumericBase: 'dec' })),
- }),
+ }, [
+ h('i.fa.fa-angle-down'),
+ ]),
]),
])
}
diff --git a/ui/app/components/pages/create-account/import-account/json.js b/ui/app/components/pages/create-account/import-account/json.js
index 32b1065aa..90279bbbd 100644
--- a/ui/app/components/pages/create-account/import-account/json.js
+++ b/ui/app/components/pages/create-account/import-account/json.js
@@ -85,7 +85,7 @@ class JsonImportSubview extends Component {
}
createNewKeychain () {
- const { firstAddress, displayWarning, importNewJsonAccount, setSelectedAddress } = this.props
+ const { firstAddress, displayWarning, importNewJsonAccount, setSelectedAddress, history } = this.props
const state = this.state
if (!state) {
diff --git a/ui/app/components/selected-account/selected-account.component.js b/ui/app/components/selected-account/selected-account.component.js
index 55b935ee0..4f98df9b6 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 } from '../../util'
+import { addressSlicer, checksumAddress } from '../../util'
const Tooltip = require('../tooltip-v2.js').default
@@ -22,6 +22,7 @@ class SelectedAccount extends Component {
render () {
const { t } = this.context
const { selectedAddress, selectedIdentity } = this.props
+ const checksummedAddress = checksumAddress(selectedAddress)
return (
<div className="selected-account">
@@ -34,14 +35,14 @@ class SelectedAccount extends Component {
onClick={() => {
this.setState({ copied: true })
setTimeout(() => this.setState({ copied: false }), 3000)
- copyToClipboard(selectedAddress)
+ copyToClipboard(checksummedAddress)
}}
>
<div className="selected-account__name">
{ selectedIdentity.name }
</div>
<div className="selected-account__address">
- { addressSlicer(selectedAddress) }
+ { addressSlicer(checksummedAddress) }
</div>
</div>
</Tooltip>
diff --git a/ui/app/components/selected-account/tests/selected-account-component.test.js b/ui/app/components/selected-account/tests/selected-account-component.test.js
new file mode 100644
index 000000000..78a94d1c8
--- /dev/null
+++ b/ui/app/components/selected-account/tests/selected-account-component.test.js
@@ -0,0 +1,16 @@
+import React from 'react'
+import assert from 'assert'
+import { render } from 'enzyme'
+import SelectedAccount from '../selected-account.component'
+
+describe('SelectedAccount Component', () => {
+ it('should render checksummed address', () => {
+ const wrapper = render(<SelectedAccount
+ selectedAddress="0x1b82543566f41a7db9a9a75fc933c340ffb55c9d"
+ selectedIdentity={{ name: 'testName' }}
+ />, { context: { t: () => {}}})
+ // Checksummed version of address is displayed
+ assert.equal(wrapper.find('.selected-account__address').text(), '0x1B82...5C9D')
+ assert.equal(wrapper.find('.selected-account__name').text(), 'testName')
+ })
+})
diff --git a/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js b/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js
index d57ff130a..f65ff4d55 100644
--- a/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js
+++ b/ui/app/components/transaction-list-item-details/transaction-list-item-details.component.js
@@ -13,8 +13,9 @@ export default class TransactionListItemDetails extends PureComponent {
}
static propTypes = {
- transaction: PropTypes.object,
+ onRetry: PropTypes.func,
showRetry: PropTypes.bool,
+ transaction: PropTypes.object,
}
handleEtherscanClick = () => {
@@ -26,6 +27,13 @@ export default class TransactionListItemDetails extends PureComponent {
this.setState({ showTransactionDetails: true })
}
+ handleRetry = event => {
+ const { onRetry } = this.props
+
+ event.stopPropagation()
+ onRetry()
+ }
+
render () {
const { t } = this.context
const { transaction, showRetry } = this.props
@@ -40,7 +48,7 @@ export default class TransactionListItemDetails extends PureComponent {
showRetry && (
<Button
type="raised"
- onClick={this.handleEtherscanClick}
+ onClick={this.handleRetry}
className="transaction-list-item-details__header-button"
>
{ t('speedUp') }
diff --git a/ui/app/components/transaction-list-item/transaction-list-item.component.js b/ui/app/components/transaction-list-item/transaction-list-item.component.js
index 5564f0883..e590e96e0 100644
--- a/ui/app/components/transaction-list-item/transaction-list-item.component.js
+++ b/ui/app/components/transaction-list-item/transaction-list-item.component.js
@@ -42,9 +42,7 @@ export default class TransactionListItem extends PureComponent {
this.setState({ showTransactionDetails: !showTransactionDetails })
}
- handleRetryClick = event => {
- event.stopPropagation()
-
+ handleRetry = () => {
const {
transaction: { txParams: { to } = {} },
methodData: { name } = {},
@@ -156,6 +154,7 @@ export default class TransactionListItem extends PureComponent {
<TransactionListItemDetails
transaction={transaction}
showRetry={showRetry && methodData.done}
+ onRetry={this.handleRetry}
/>
</div>
)
diff --git a/ui/app/css/itcss/components/send.scss b/ui/app/css/itcss/components/send.scss
index 4f97fc662..7fc960d7d 100644
--- a/ui/app/css/itcss/components/send.scss
+++ b/ui/app/css/itcss/components/send.scss
@@ -622,14 +622,14 @@
position: relative;
&__down-caret {
- z-index: 1051;
+ z-index: 1026;
position: absolute;
top: 18px;
right: 12px;
}
&__qr-code {
- z-index: 1051;
+ z-index: 1026;
position: absolute;
top: 13px;
right: 33px;
@@ -649,7 +649,7 @@
&__to-autocomplete, &__memo-text-area, &__hex-data {
&__input {
- z-index: 1050;
+ z-index: 1025;
position: relative;
height: 54px;
width: 100%;
@@ -888,12 +888,21 @@
font-size: 18px;
color: $tundora;
right: 0px;
- padding: 1px 4px;
+ padding: 0;
display: flex;
justify-content: space-around;
align-items: center;
}
+ .gas-tooltip-input-arrow-wrapper {
+ align-items: center;
+ align-self: stretch;
+ display: flex;
+ flex-direction: column;
+ flex-grow: 1;
+ justify-content: center;
+ }
+
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;