Browse Source
Merge pull request #459 from gre/fix-countervalues-testnet
Fix countervalues for testnets
master
Meriadec Pillet
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
10 additions and
7 deletions
-
package.json
-
src/helpers/countervalues.js
-
src/reducers/settings.js
-
yarn.lock
|
|
@ -42,7 +42,7 @@ |
|
|
|
"@ledgerhq/hw-transport": "^4.12.0", |
|
|
|
"@ledgerhq/hw-transport-node-hid": "^4.12.0", |
|
|
|
"@ledgerhq/ledger-core": "1.4.5", |
|
|
|
"@ledgerhq/live-common": "2.27.1", |
|
|
|
"@ledgerhq/live-common": "2.29.0", |
|
|
|
"axios": "^0.18.0", |
|
|
|
"babel-runtime": "^6.26.0", |
|
|
|
"bcryptjs": "^2.4.3", |
|
|
|
|
|
@ -20,7 +20,7 @@ const pairsSelector = createSelector( |
|
|
|
[ |
|
|
|
{ from: intermediaryCurrency, to: counterValueCurrency, exchange: counterValueExchange }, |
|
|
|
].concat( |
|
|
|
currencies.filter(c => c !== intermediaryCurrency).map(currency => ({ |
|
|
|
currencies.filter(c => c.ticker !== intermediaryCurrency.ticker).map(currency => ({ |
|
|
|
from: currency, |
|
|
|
to: intermediaryCurrency, |
|
|
|
exchange: currencySettingsSelector(state, { currency }).exchange, |
|
|
|
|
|
@ -98,12 +98,15 @@ const handlers: Object = { |
|
|
|
copy.currenciesSettings = { ...copy.currenciesSettings } |
|
|
|
for (const { to, from, exchange } of pairs) { |
|
|
|
const fromCrypto = asCryptoCurrency(from) |
|
|
|
if (fromCrypto && to === intermediaryCurrency) { |
|
|
|
if (fromCrypto && to.ticker === intermediaryCurrency.ticker) { |
|
|
|
copy.currenciesSettings[fromCrypto.id] = { |
|
|
|
...copy.currenciesSettings[fromCrypto.id], |
|
|
|
exchange, |
|
|
|
} |
|
|
|
} else if (from === intermediaryCurrency && to === counterValueCurrency) { |
|
|
|
} else if ( |
|
|
|
from.ticker === intermediaryCurrency.ticker && |
|
|
|
to.ticker === counterValueCurrency.ticker |
|
|
|
) { |
|
|
|
copy.counterValueExchange = exchange |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -1495,9 +1495,9 @@ |
|
|
|
npm "^5.7.1" |
|
|
|
prebuild-install "^2.2.2" |
|
|
|
|
|
|
|
"@ledgerhq/live-common@2.27.1": |
|
|
|
version "2.27.1" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.27.1.tgz#3ea96eb80b3e2676529c805c76e6b20ce14b95f0" |
|
|
|
"@ledgerhq/live-common@2.29.0": |
|
|
|
version "2.29.0" |
|
|
|
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-2.29.0.tgz#a8f8a023f12973a60b2f89882534597f0723929f" |
|
|
|
dependencies: |
|
|
|
axios "^0.18.0" |
|
|
|
invariant "^2.2.2" |
|
|
|