diff --git a/CHANGELOG.md b/CHANGELOG.md index 84db0f280b38..7a0c1faf9c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ ## 7.3.0 Fri Sep 27 2019 - [#7168](https://github.com/MetaMask/metamask-extension/pull/7168): Add fixes for German translations +## 7.2.3 Fri Oct 04 2019 +- [#7252](https://github.com/MetaMask/metamask-extension/pull/7252): Fix gas limit when sending tx without data to a contract +- [#7260](https://github.com/MetaMask/metamask-extension/pull/7260): Do not transate on seed phrases + +## 7.2.2 Tue Sep 24 2019 +- [#7213](https://github.com/MetaMask/metamask-extension/pull/7213): Update minimum Firefox verison to 56.0 + ## 7.2.1 Tue Sep 17 2019 - [#7180](https://github.com/MetaMask/metamask-extension/pull/7180): Add `appName` message to each locale diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index c69b82673d03..22ea58142b09 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -603,21 +603,21 @@ class TransactionController extends EventEmitter { ].find(tokenMethodName => tokenMethodName === name && name.toLowerCase()) let result - let code - if (!txParams.data) { - result = SEND_ETHER_ACTION_KEY - } else if (tokenMethodName) { + if (txParams.data && tokenMethodName) { result = tokenMethodName - } else if (!to) { + } else if (txParams.data && !to) { result = DEPLOY_CONTRACT_ACTION_KEY - } else { + } + + let code + if (!result) { try { code = await this.query.getCode(to) } catch (e) { code = null log.warn(e) } - // For an address with no code, geth will return '0x', and ganache-core v2.2.1 will return '0x0' + const codeIsEmpty = !code || code === '0x' || code === '0x0' result = codeIsEmpty ? SEND_ETHER_ACTION_KEY : CONTRACT_INTERACTION_KEY diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index 664cc4b6bed3..eed712736e1b 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -563,19 +563,20 @@ describe('MetaMask', function () { const dapp = windowHandles[1] await driver.switchTo().window(dapp) - await delay(regularDelayMs) + await delay(largeDelayMs) const send3eth = await findElement(driver, By.xpath(`//button[contains(text(), 'Send')]`), 10000) await send3eth.click() - await delay(regularDelayMs) + await delay(largeDelayMs) const contractDeployment = await findElement(driver, By.xpath(`//button[contains(text(), 'Deploy Contract')]`), 10000) await contractDeployment.click() - await delay(regularDelayMs) + await delay(largeDelayMs) await send3eth.click() + await delay(largeDelayMs) await contractDeployment.click() - await delay(regularDelayMs) + await delay(largeDelayMs) await driver.switchTo().window(extension) await delay(regularDelayMs) diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js index 9072dc684caf..642e1b6afd8b 100644 --- a/test/unit/app/controllers/transactions/tx-controller-test.js +++ b/test/unit/app/controllers/transactions/tx-controller-test.js @@ -622,6 +622,36 @@ describe('Transaction Controller', function () { }) assert.deepEqual(result, { transactionCategory: CONTRACT_INTERACTION_KEY, getCodeResponse: '0x0a' }) }) + + it('should return a contract interaction transactionCategory with the correct getCodeResponse when to is a contract address and data is falsey', async function () { + const _providerResultStub = { + // 1 gwei + eth_gasPrice: '0x0de0b6b3a7640000', + // by default, all accounts are external accounts (not contracts) + eth_getCode: '0xa', + } + const _provider = createTestProviderTools({ scaffold: _providerResultStub }).provider + const _fromAccount = getTestAccounts()[0] + const _blockTrackerStub = new EventEmitter() + _blockTrackerStub.getCurrentBlock = noop + _blockTrackerStub.getLatestBlock = noop + const _txController = new TransactionController({ + provider: _provider, + getGasPrice: function () { return '0xee6b2800' }, + networkStore: new ObservableStore(currentNetworkId), + txHistoryLimit: 10, + blockTracker: _blockTrackerStub, + signTransaction: (ethTx) => new Promise((resolve) => { + ethTx.sign(_fromAccount.key) + resolve() + }), + }) + const result = await _txController._determineTransactionCategory({ + to: '0x9e673399f795D01116e9A8B2dD2F156705131ee9', + data: '', + }) + assert.deepEqual(result, { transactionCategory: CONTRACT_INTERACTION_KEY, getCodeResponse: '0x0a' }) + }) }) describe('#getPendingTransactions', function () { diff --git a/ui/app/components/ui/export-text-container/export-text-container.component.js b/ui/app/components/ui/export-text-container/export-text-container.component.js index c632e8f26910..21fd5ecec24e 100644 --- a/ui/app/components/ui/export-text-container/export-text-container.component.js +++ b/ui/app/components/ui/export-text-container/export-text-container.component.js @@ -12,7 +12,7 @@ class ExportTextContainer extends Component { return ( h('.export-text-container', [ h('.export-text-container__text-container', [ - h('.export-text-container__text', text), + h('.export-text-container__text.notranslate', text), ]), h('.export-text-container__buttons-container', [ h('.export-text-container__button.export-text-container__button--copy', { diff --git a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/draggable-seed.component.js b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/draggable-seed.component.js index cdb8819217ac..b0afd4c419e9 100644 --- a/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/draggable-seed.component.js +++ b/ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/draggable-seed.component.js @@ -52,7 +52,7 @@ class DraggableSeed extends Component { return connectDropTarget(connectDragSource(