Skip to content

Commit

Permalink
Merge pull request MyEtherWallet#2544 from MyEtherWallet/bug/fix-gas-…
Browse files Browse the repository at this point in the history
…price-too-high-check

Fix missed cases for gas price too high
  • Loading branch information
gamalielhere authored Aug 19, 2020
2 parents 74aa251 + 629d733 commit 21917ed
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 30 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
### Bug

- Fix missed cases for gas price too high, add warning for VET [#2544](https://github.com/MyEtherWallet/MyEtherWallet/pull/2544)

### Release v5.7.5

### Devop

- Update MEW wallet from MEWconnect [#2542](https://github.com/MyEtherWallet/MyEtherWallet/pull/2542)
Expand Down
2 changes: 1 addition & 1 deletion fetchLists/lists/tokens.json

Large diffs are not rendered by default.

49 changes: 32 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

$swap-custom-mobile-colleps-width: 700px;


.swap-warning-message{
margin: 0 auto;
text-align: center;
//width: 300px;
background-color: $light-orange-1;
position: relative;
//color: $light-orange-1;
border-radius: 5px;
border: 1px solid $light-green-1;
@media all and (max-width: $mobile-width) {
width: 100%;
}

i {
position: absolute;
right: 20px;
top: 16px;
font-size: 30px;
}
}
.fee-notice {
text-align: center;
color: $text-color-red;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<div class="title-block">
<interface-container-title :title="$t('common.swap')" />
</div>

<div v-if="showWarning" class="swap-warning-message">
{{ $t('swap.warning.currency-warning', { currency: toCurrency }) }}
</div>
<div class="form-content-container">
<div class="send-form">
<div class="form-block amount-to-address">
Expand Down Expand Up @@ -307,6 +309,7 @@ export default {
lastBestRate: 0,
lastFeeEstimate: new BigNumber(0),
bitySpecialCurrencies: ['BTC', 'REP'],
warningCurrencies: ['VET'],
selectedProvider: {},
swapDetails: {},
currencyDetails: {},
Expand Down Expand Up @@ -353,6 +356,7 @@ export default {
gasNotice: false,
moreEthNeeded: false,
recalculating: true,
showWarning: false,
exitToFiatCallback: () => {},
sendSignedCallback: () => {},
debounceUpdateEstimate: {},
Expand Down Expand Up @@ -829,6 +833,7 @@ export default {
},
async updateRateEstimate(fromCurrency, toCurrency, fromValue, to) {
if (this.haveProviderRates) {
this.showWarning = this.warningCurrencies.includes(toCurrency);
this.loadingData = true;
this.recalculating = true;
this.noProvidersPair = { fromCurrency, toCurrency };
Expand Down
13 changes: 3 additions & 10 deletions src/partners/dexAg/dexAg.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,10 @@ export default class DexAg {
value: tradeDetails.trade.value
};

const bancorGas =
tradeDetails.metadata.gasPrice &&
swapDetails.provider === 'bancor' &&
this.platformGasPrice > 0;
const checkGas =
tradeDetails.metadata.gasPrice && this.platformGasPrice > 0;

const kyberGas =
tradeDetails.metadata.gasPrice &&
swapDetails.provider === 'kyber' &&
this.platformGasPrice > 0;

if (bancorGas || kyberGas) {
if (checkGas) {
const gasPrice = new BigNumber(tradeDetails.metadata.gasPrice);
const platformGasPrice = this.web3.utils.toWei(
this.platformGasPrice.toString(),
Expand Down
3 changes: 2 additions & 1 deletion src/translations/swap/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"error-generating-swap": "An error occurred while finalizing the swap details",
"not-enough-eth-gas": "Insufficient balance for Amount + Transaction Fee.",
"not-enough-tx-fee": "Insufficient balance for Transaction Fee.",
"liquidity-too-low": "The amount requested is greater than the amount available at this time"
"liquidity-too-low": "The amount requested is greater than the amount available at this time",
"currency-warning": "Make sure you have a compatible {currency} wallet for this swap, MEW does not support {currency}."
},
"notice": {
"retrieve-changelly-rate-failed": "Failed to retrieve Changelly rate from {fromCurrency} to {toCurrency}",
Expand Down

0 comments on commit 21917ed

Please sign in to comment.