From d56bf1dedc8c5b2a903f0a68bd361ba12ab49a1c Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 28 Jul 2021 15:13:08 -0230 Subject: [PATCH 1/4] Use current block gas limit as the limit passed eth_estimateGas (#11658) --- ui/ducks/send/send.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/ducks/send/send.js b/ui/ducks/send/send.js index 30ddb2d80..3039af5c9 100644 --- a/ui/ducks/send/send.js +++ b/ui/ducks/send/send.js @@ -350,7 +350,7 @@ export const computeEstimatedGasLimit = createAsyncThunk( if (send.stage !== SEND_STAGES.EDIT) { const gasLimit = await estimateGasLimitForSend({ gasPrice: send.gas.gasPrice, - blockGasLimit: metamask.blockGasLimit, + blockGasLimit: metamask.currentBlockGasLimit, selectedAddress: metamask.selectedAddress, sendToken: send.asset.details, to: send.recipient.address?.toLowerCase(), @@ -425,7 +425,7 @@ export const initializeSendState = createAsyncThunk( // required gas. If this value isn't nullish, set it as the new gasLimit const estimatedGasLimit = await estimateGasLimitForSend({ gasPrice: getGasPriceInHexWei(basicEstimates.average), - blockGasLimit: metamask.blockGasLimit, + blockGasLimit: metamask.currentBlockGasLimit, selectedAddress: fromAddress, sendToken: asset.details, to: recipient.address.toLowerCase(), From 3010c1b565410ab6ae8ddc6f5ba1d3654037aafe Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Wed, 28 Jul 2021 18:16:18 +0000 Subject: [PATCH 2/4] Version v9.8.4 --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5da4b270..43053c7c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [9.8.4] +### Uncategorized +- Use current block gas limit as the limit passed eth_estimateGas ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) +- Revert "Use current block gas limit as the limit passed eth_estimateGas (#11658)" ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) +- Use current block gas limit as the limit passed eth_estimateGas ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) + ## [9.8.3] ### Fixed - [#11594](https://github.com/MetaMask/metamask-extension/pull/11594): Fixed ERC20 token maximum send @@ -2349,7 +2355,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.8.3...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.8.4...HEAD +[9.8.4]: https://github.com/MetaMask/metamask-extension/compare/v9.8.3...v9.8.4 [9.8.3]: https://github.com/MetaMask/metamask-extension/compare/v9.8.2...v9.8.3 [9.8.2]: https://github.com/MetaMask/metamask-extension/compare/v9.8.1...v9.8.2 [9.8.1]: https://github.com/MetaMask/metamask-extension/compare/v9.8.0...v9.8.1 diff --git a/package.json b/package.json index 70ab3b396..814c445cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "9.8.3", + "version": "9.8.4", "private": true, "repository": { "type": "git", From 404f876026df35559b643818d5026ee5a52c33b8 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 28 Jul 2021 16:08:54 -0230 Subject: [PATCH 3/4] Allow higher precision gas prices in the send flow (#11652) * Allow higher precision gas prices in the send flow * Fix gas duck test * Allow more decimals in transaction breakdown gas price --- .../transaction-breakdown/transaction-breakdown.component.js | 1 + ui/ducks/gas/gas-duck.test.js | 2 +- ui/ducks/gas/gas.duck.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js index 4698819cf..1da46f205 100644 --- a/ui/components/app/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/components/app/transaction-breakdown/transaction-breakdown.component.js @@ -95,6 +95,7 @@ export default class TransactionBreakdown extends PureComponent { currency={nativeCurrency} denomination={GWEI} value={gasPrice} + numberOfDecimals={9} hideLabel /> )} diff --git a/ui/ducks/gas/gas-duck.test.js b/ui/ducks/gas/gas-duck.test.js index 221e4dbd8..f7d0b3a58 100644 --- a/ui/ducks/gas/gas-duck.test.js +++ b/ui/ducks/gas/gas-duck.test.js @@ -198,7 +198,7 @@ describe('Gas Duck', () => { { type: SET_BASIC_GAS_ESTIMATE_DATA, value: { - average: 0.0482, + average: 0.048199313, }, }, ]); diff --git a/ui/ducks/gas/gas.duck.js b/ui/ducks/gas/gas.duck.js index a41c313c5..a9858a0c6 100644 --- a/ui/ducks/gas/gas.duck.js +++ b/ui/ducks/gas/gas.duck.js @@ -173,7 +173,7 @@ async function fetchEthGasPriceEstimates(state) { const gasPrice = await global.eth.gasPrice(); const averageGasPriceInDecGWEI = getValueFromWeiHex({ value: gasPrice.toString(16), - numberOfDecimals: 4, + numberOfDecimals: 9, toDenomination: 'GWEI', }); const basicEstimates = { From c3c43ae62c19205bac469dd8566d234843076d11 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 28 Jul 2021 11:59:36 -0700 Subject: [PATCH 4/4] [skip e2e] Update changelog for v9.8.4 (#11665) --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43053c7c1..33fa8db78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [9.8.4] -### Uncategorized -- Use current block gas limit as the limit passed eth_estimateGas ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) -- Revert "Use current block gas limit as the limit passed eth_estimateGas (#11658)" ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) -- Use current block gas limit as the limit passed eth_estimateGas ([#11658](https://github.com/MetaMask/metamask-extension/pull/11658)) +### Changed +- [#11652](https://github.com/MetaMask/metamask-extension/pull/11652): Allow higher precision gas prices in send flow + +### Fixed +- [#11658](https://github.com/MetaMask/metamask-extension/pull/11658): Fixed incorrect gas limit estimates for send transactions ## [9.8.3] ### Fixed