Browse Source

Prefix ticker units with 't' when running on testnet

renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
08fbed672f
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 6
      app/reducers/info.js
  2. 12
      app/reducers/ticker.js
  3. 1
      test/reducers/__snapshots__/info.spec.js.snap

6
app/reducers/info.js

@ -39,11 +39,13 @@ export const receiveInfo = (event, data) => (dispatch) => {
const networks = {
testnet: {
explorerUrl: 'https://testnet.smartbit.com.au',
bitcoinJsNetwork: bitcoin.networks.testnet
bitcoinJsNetwork: bitcoin.networks.testnet,
unitPrefix: 't'
},
mainnet: {
explorerUrl: 'https://smartbit.com.au',
bitcoinJsNetwork: bitcoin.networks.bitcoin
bitcoinJsNetwork: bitcoin.networks.bitcoin,
unitPrefix: ''
}
}
// IPC info fetch failed

12
app/reducers/ticker.js

@ -1,5 +1,7 @@
import { createSelector } from 'reselect'
import { requestTickers } from '../api'
import { infoSelectors } from './info'
// ------------------------------------
// Constants
// ------------------------------------
@ -97,11 +99,13 @@ tickerSelectors.currentCurrencyFilters = createSelector(
tickerSelectors.currencyName = createSelector(
currencySelector,
(currency) => {
if (currency === 'btc') { return 'BTC' }
if (currency === 'sats') { return 'satoshis' }
infoSelectors.networkSelector,
(currency, network) => {
let unit = currency
if (currency === 'btc') { unit = 'BTC' }
if (currency === 'sats') { unit = 'satoshis' }
return currency
return `${network.unitPrefix}${unit}`
}
)

1
test/reducers/__snapshots__/info.spec.js.snap

@ -27,6 +27,7 @@ Object {
"wif": 128,
},
"explorerUrl": "https://smartbit.com.au",
"unitPrefix": "",
},
"showWalletCurrencyFilters": false,
}

Loading…
Cancel
Save