Skip to content

Commit

Permalink
Merge pull request #420 from poanetwork/develop
Browse files Browse the repository at this point in the history
NW release 5.1.6
  • Loading branch information
vbaranov authored Oct 27, 2020
2 parents 26e8e73 + 14c9107 commit 2811647
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Current Master

## 5.1.6 Tue Oct 27 2020

- [#419](https://github.com/poanetwork/nifty-wallet/pull/419) - Add 10% margin for gas price in case of RSK chains

## 5.1.5 Tue Oct 20 2020

- [#416](https://github.com/poanetwork/nifty-wallet/pull/416) - Change Copy token address text
Expand Down
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "5.1.5",
"version": "5.1.6",
"manifest_version": 2,
"author": "POA Network",
"description": "__MSG_appDescription__",
Expand Down
8 changes: 6 additions & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,12 @@ module.exports = class MetamaskController extends EventEmitter {

const gasPrice = recentBlock && recentBlock.minimumGasPrice && recentBlock.minimumGasPrice.toString()

if (gasPrice !== '0x' && gasPrice !== '0x0' && gasPrice !== '') {
return gasPrice
const gasPriceInt = parseInt(gasPrice, 16)
// https://forum.poa.network/t/gasprice-lower-than-minimumgasprice-in-rsk/4034
const gasPriceMargin = '0x' + parseInt(gasPriceInt * 1.1).toString(16)

if (!isNaN(gasPriceInt)) {
return gasPriceMargin
} else {
return '0x' + GWEI_BN.toString(16)
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/controllers/metamask-controller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('MetaMaskController', function () {
metamaskController.recentBlocksController = recentBlocksController1

const gasPrice = await metamaskController.getGasPrice()
assert.equal(gasPrice, '0x387ee40', 'takes the min gas price from the latest block')
assert.equal(gasPrice, '0x3e252e0', 'takes the min gas price from the latest block')

metamaskController.recentBlocksController = realRecentBlocksController
})
Expand Down

0 comments on commit 2811647

Please sign in to comment.