1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Merge pull request #9267 from MetaMask/Version-v8.0.9

Version v8.0.9 RC
This commit is contained in:
Mark Stacey 2020-08-19 17:51:45 -03:00 committed by GitHub
commit a9202748d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 126 additions and 65 deletions

View File

@ -2,6 +2,12 @@
## Current Develop Branch
## 8.0.9 Wed Aug 19 2020
- [#9228](https://github.com/MetaMask/metamask-extension/pull/9228): Move transaction confirmation footer buttons to scrollable area
- [#9256](https://github.com/MetaMask/metamask-extension/pull/9256): Handle non-String web3 property access
- [#9266](https://github.com/MetaMask/metamask-extension/pull/9266): Use @metamask/controllers@2.0.5
- [#9189](https://github.com/MetaMask/metamask-extension/pull/9189): Hide ETH Gas Station estimates on non-main network
## 8.0.8 Fri Aug 14 2020
- [#9211](https://github.com/MetaMask/metamask-extension/pull/9211): Fix Etherscan redirect on notification click
- [#9237](https://github.com/MetaMask/metamask-extension/pull/9237): Reduce volume of web3 usage metrics

View File

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

View File

@ -44,9 +44,10 @@ export default function setupWeb3 (log) {
}
if (shouldLogUsage) {
const name = stringifyKey(key)
window.ethereum.request({
method: 'metamask_logInjectedWeb3Usage',
params: [{ action: 'window.web3 get', name: key }],
params: [{ action: 'window.web3 get', name }],
})
}
@ -54,11 +55,11 @@ export default function setupWeb3 (log) {
return _web3[key]
},
set: (_web3, key, value) => {
const name = stringifyKey(key)
if (shouldLogUsage) {
window.ethereum.request({
method: 'metamask_logInjectedWeb3Usage',
params: [{ action: 'window.web3 set', name: key }],
params: [{ action: 'window.web3 set', name }],
})
}
@ -120,3 +121,15 @@ export default function setupWeb3 (log) {
function triggerReset () {
global.location.reload()
}
/**
* Returns a "stringified" key. Keys that are already strings are returned
* unchanged, and any non-string values are returned as "typeof <type>".
*
* @param {any} key - The key to stringify
*/
function stringifyKey (key) {
return typeof key === 'string'
? key
: `typeof ${typeof key}`
}

View File

@ -67,7 +67,7 @@
"@formatjs/intl-relativetimeformat": "^5.2.6",
"@fortawesome/fontawesome-free": "^5.13.0",
"@material-ui/core": "^4.11.0",
"@metamask/controllers": "^2.0.1",
"@metamask/controllers": "^2.0.5",
"@metamask/eth-ledger-bridge-keyring": "^0.2.6",
"@metamask/eth-token-tracker": "^3.0.0",
"@metamask/etherscan-link": "^1.1.0",

View File

@ -22,12 +22,16 @@ const ConfirmDetailRow = (props) => {
{ label }
</div>
<div className="confirm-detail-row__details">
<div
className={classnames('confirm-detail-row__header-text', headerTextClassName)}
onClick={() => onHeaderClick && onHeaderClick()}
>
{ headerText }
</div>
{
headerText && (
<div
className={classnames('confirm-detail-row__header-text', headerTextClassName)}
onClick={() => onHeaderClick && onHeaderClick()}
>
{ headerText }
</div>
)
}
{
primaryText
? (

View File

@ -4,6 +4,8 @@ import classnames from 'classnames'
import { Tabs, Tab } from '../../../ui/tabs'
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
import ErrorMessage from '../../../ui/error-message'
import { PageContainerFooter } from '../../../ui/page-container'
export default class ConfirmPageContainerContent extends Component {
static propTypes = {
@ -22,6 +24,15 @@ export default class ConfirmPageContainerContent extends Component {
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
titleComponent: PropTypes.node,
warning: PropTypes.string,
// Footer
onCancelAll: PropTypes.func,
onCancel: PropTypes.func,
cancelText: PropTypes.string,
onSubmit: PropTypes.func,
submitText: PropTypes.string,
disabled: PropTypes.bool,
unapprovedTxCount: PropTypes.number,
rejectNText: PropTypes.string,
}
renderContent () {
@ -66,6 +77,14 @@ export default class ConfirmPageContainerContent extends Component {
detailsComponent,
dataComponent,
warning,
onCancelAll,
onCancel,
cancelText,
onSubmit,
submitText,
disabled,
unapprovedTxCount,
rejectNText,
} = this.props
return (
@ -104,6 +123,21 @@ export default class ConfirmPageContainerContent extends Component {
</div>
)
}
<PageContainerFooter
onCancel={onCancel}
cancelText={cancelText}
onSubmit={onSubmit}
submitText={submitText}
submitButtonType="confirm"
disabled={disabled}
>
{unapprovedTxCount > 1 && (
<a onClick={onCancelAll}>
{rejectNText}
</a>
)}
</PageContainerFooter>
</div>
)
}

View File

@ -5,6 +5,8 @@
overflow-y: auto;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
&__error-container {
padding: 0 16px 16px 16px;
@ -72,4 +74,8 @@
text-transform: uppercase;
margin: 0 8px;
}
.page-container__footer {
margin-top: auto;
}
}

View File

@ -157,23 +157,35 @@ export default class ConfirmPageContainer extends Component {
nonce={nonce}
assetImage={assetImage}
warning={warning}
onCancelAll={onCancelAll}
onCancel={onCancel}
cancelText={this.context.t('reject')}
onSubmit={onSubmit}
submitText={this.context.t('confirm')}
disabled={disabled}
unapprovedTxCount={unapprovedTxCount}
rejectNText={this.context.t('rejectTxsN', [unapprovedTxCount])}
/>
)
}
<PageContainerFooter
onCancel={() => onCancel()}
cancelText={this.context.t('reject')}
onSubmit={() => onSubmit()}
submitText={this.context.t('confirm')}
submitButtonType="confirm"
disabled={disabled}
>
{unapprovedTxCount > 1 && (
<a onClick={() => onCancelAll()}>
{this.context.t('rejectTxsN', [unapprovedTxCount])}
</a>
)}
</PageContainerFooter>
{
contentComponent && (
<PageContainerFooter
onCancel={onCancel}
cancelText={this.context.t('reject')}
onSubmit={onSubmit}
submitText={this.context.t('confirm')}
submitButtonType="confirm"
disabled={disabled}
>
{unapprovedTxCount > 1 && (
<a onClick={onCancelAll}>
{this.context.t('rejectTxsN', [unapprovedTxCount])}
</a>
)}
</PageContainerFooter>
)
}
</div>
)
}

View File

@ -97,6 +97,7 @@ export default class ConfirmTransactionBase extends Component {
hideSenderToRecipient: PropTypes.bool,
showAccountInHeader: PropTypes.bool,
mostRecentOverviewPage: PropTypes.string.isRequired,
isMainnet: PropTypes.bool,
}
state = {
@ -236,12 +237,15 @@ export default class ConfirmTransactionBase extends Component {
hideFiatConversion,
nextNonce,
getNextNonce,
isMainnet,
} = this.props
if (hideDetails) {
return null
}
const notMainnetOrTest = !(isMainnet || process.env.IN_TEST)
return (
detailsComponent || (
<div className="confirm-page-container-content__details">
@ -249,12 +253,12 @@ export default class ConfirmTransactionBase extends Component {
<ConfirmDetailRow
label="Gas Fee"
value={hexTransactionFee}
headerText="Edit"
headerTextClassName="confirm-detail-row__header-text--edit"
onHeaderClick={() => this.handleEditGas()}
headerText={notMainnetOrTest ? '' : 'Edit'}
headerTextClassName={notMainnetOrTest ? '' : 'confirm-detail-row__header-text--edit'}
onHeaderClick={notMainnetOrTest ? null : () => this.handleEditGas()}
secondaryText={hideFiatConversion ? this.context.t('noConversionRateAvailable') : ''}
/>
{advancedInlineGasShown
{advancedInlineGasShown || notMainnetOrTest
? (
<AdvancedGasInputs
updateCustomGasPrice={(newGasPrice) => updateGasAndCalculate({ ...customGas, gasPrice: newGasPrice })}

View File

@ -180,6 +180,7 @@ const mapStateToProps = (state, ownProps) => {
transactionCategory,
nextNonce,
mostRecentOverviewPage: getMostRecentOverviewPage(state),
isMainnet,
}
}

View File

@ -26,6 +26,7 @@ export default class SendGasRow extends Component {
gasPrice: PropTypes.string,
gasLimit: PropTypes.string,
insufficientBalance: PropTypes.bool,
isMainnet: PropTypes.bool,
}
static contextTypes = {
@ -35,7 +36,11 @@ export default class SendGasRow extends Component {
renderAdvancedOptionsButton () {
const { metricsEvent } = this.context
const { showCustomizeGasModal } = this.props
const { showCustomizeGasModal, isMainnet } = this.props
// Tests should behave in same way as mainnet, but are using Localhost
if (!isMainnet && !process.env.IN_TEST) {
return null
}
return (
<div
className="advanced-gas-options-btn"
@ -87,6 +92,7 @@ export default class SendGasRow extends Component {
gasPrice,
gasLimit,
insufficientBalance,
isMainnet,
} = this.props
const { metricsEvent } = this.context
@ -140,8 +146,8 @@ export default class SendGasRow extends Component {
{ this.renderAdvancedOptionsButton() }
</div>
)
if (advancedInlineGasShown) {
// Tests should behave in same way as mainnet, but are using Localhost
if (advancedInlineGasShown || (!isMainnet && !process.env.IN_TEST)) {
return advancedGasInputs
} else if (gasButtonGroupShown) {
return gasPriceButtonGroup

View File

@ -17,6 +17,7 @@ import {
getBasicGasEstimateLoadingStatus,
getRenderableEstimateDataForSmallButtonsFromGWEI,
getDefaultActiveButtonIndex,
getIsMainnet,
} from '../../../../selectors'
import {
isBalanceSufficient,
@ -74,6 +75,7 @@ function mapStateToProps (state) {
maxModeOn: getSendMaxModeState(state),
sendToken: getSendToken(state),
tokenBalance: getTokenBalance(state),
isMainnet: getIsMainnet(state),
}
}

View File

@ -34,6 +34,7 @@ describe('SendGasRow Component', function () {
}}
/>
), { context: { t: (str) => str + '_t', metricsEvent: () => ({}) } })
wrapper.setProps({ isMainnet: true })
})
afterEach(function () {

View File

@ -1702,48 +1702,20 @@
prop-types "^15.7.2"
react-is "^16.8.0"
"@metamask/controllers@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-2.0.1.tgz#33b0e2826fb6d4aa582acaff6b347e6abe0f54f5"
integrity sha512-xioh4h+4D2pUSJ9H2CaffxKGmlg0kUK2bbRJ8c9GXPVTo8KhRHryvNKfkVCyoSt35FLROzzwTEdVJ4dmUFuELQ==
"@metamask/controllers@^2.0.2", "@metamask/controllers@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-2.0.5.tgz#302dbae0595b269f2660253ee40c4c7f9bce069e"
integrity sha512-i+BjTEMy0XQFdcyXeEHmQ7xzktdNPBuw/R9QNBIllOvV4atR0JkZ9of6hi4tDFyjV40CBudqnIgS0iUVLWNGbA==
dependencies:
await-semaphore "^0.1.3"
eth-contract-metadata "^1.11.0"
eth-ens-namehash "^2.0.8"
eth-json-rpc-errors "^2.0.2"
eth-json-rpc-infura "^4.0.1"
eth-keyring-controller "^5.6.1"
eth-method-registry "1.1.0"
eth-phishing-detect "^1.1.13"
eth-query "^2.1.2"
eth-sig-util "^2.3.0"
ethereumjs-util "^6.1.0"
ethereumjs-wallet "0.6.0"
ethjs-query "^0.3.8"
human-standard-collectible-abi "^1.0.2"
human-standard-token-abi "^2.0.0"
isomorphic-fetch "^2.2.1"
jsonschema "^1.2.4"
percentile "^1.2.1"
single-call-balance-checker-abi "^1.0.0"
uuid "^3.3.2"
web3 "^0.20.7"
web3-provider-engine "^15.0.4"
"@metamask/controllers@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-2.0.2.tgz#100a5d87b6061751b39edec2288f16f07d471e2d"
integrity sha512-KKxNguTEdkzwvfv2Hl4BE2OMGULLeh7df6iAwcEG8ipXWbTWGZsLr13DBrczQxRi8TiNPaksAakv++6sMu6ngA==
dependencies:
await-semaphore "^0.1.3"
eth-contract-metadata "^1.11.0"
eth-ens-namehash "^2.0.8"
eth-json-rpc-errors "^2.0.2"
eth-json-rpc-infura "^4.0.1"
eth-keyring-controller "^5.6.1"
eth-method-registry "1.1.0"
eth-phishing-detect "^1.1.13"
eth-query "^2.1.2"
eth-rpc-errors "^2.1.1"
eth-sig-util "^2.3.0"
ethereumjs-util "^6.1.0"
ethereumjs-wallet "0.6.0"