Skip to content

Commit

Permalink
Merge branch 'develop' into eip-712
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpshr authored Sep 17, 2018
2 parents 42fdcf6 + 2f14f97 commit daca7f9
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 19 additions & 0 deletions app/scripts/inpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
13 changes: 8 additions & 5 deletions ui/app/components/input-number.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]),
]),
])
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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">
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -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
Expand All @@ -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') }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {},
Expand Down Expand Up @@ -156,6 +154,7 @@ export default class TransactionListItem extends PureComponent {
<TransactionListItemDetails
transaction={transaction}
showRetry={showRetry && methodData.done}
onRetry={this.handleRetry}
/>
</div>
)
Expand Down
17 changes: 13 additions & 4 deletions ui/app/css/itcss/components/send.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -649,7 +649,7 @@

&__to-autocomplete, &__memo-text-area, &__hex-data {
&__input {
z-index: 1050;
z-index: 1025;
position: relative;
height: 54px;
width: 100%;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit daca7f9

Please sign in to comment.